bld-detekt/README.md
2023-11-25 14:41:22 -08:00

2.1 KiB
Executable file

bld Extension to Perform Static Code Analysis with Detekt for Kotlin

License Java bld Release Snapshot GitHub CI

To install, please refer to the extensions documentation.

To check all Kotlin source code located src/main/kotlin and src/test/kotlin, add the following to your build file

@BuildCommand(summary = "Check source with Detekt")
public void detekt() throws ExitStatusException, IOException, InterruptedException {
    new DetektOperation()
        .fromProject(this)
        .execute();
}
./bld compile detekt

To generate a Detekt baseline, add the following to your build file:

@BuildCommand(value = "detekt-baseline", summary = "Creates a Detekt baseline")
public void detektBaseline() throws ExitStatusException, IOException, InterruptedException {
    new DetektOperation()
        .fromProject(this)
        .baseline("detekt-baseline.xml")
        .createBaseline(true)
        .execute();
}
./bld compile detekt-baseline

Please check the DetektOperation documentation for all available configuration options.