bld extension to perform static code analysis with Detekt for Kotlin https://github.com/rife2/bld-detekt
Find a file
2025-03-24 19:01:12 -07:00
.github/workflows Add baseline file for testing 2025-03-24 17:36:30 -07:00
.idea Bump bld to version 2.2.1 2025-02-24 22:48:05 -08:00
.vscode Bump bld to version 2.2.1 2025-02-24 22:48:05 -08:00
config Updated dependencies 2024-10-27 17:03:26 -07:00
examples Add baseline file for testing 2025-03-24 17:36:30 -07:00
lib/bld Bump PMD extension to version 1.2.1 2025-03-18 13:06:22 -07:00
scripts Execute cliargs script before running tests 2024-05-28 13:54:33 -07:00
src Disable cleanPath() for testing 2025-03-24 19:01:12 -07:00
.gitignore Initial commit 2023-11-25 14:41:22 -08:00
bld Initial commit 2023-11-25 14:41:22 -08:00
bld.bat Initial commit 2023-11-25 14:41:22 -08:00
README.md Add generic installation instructions 2025-03-18 13:07:29 -07:00

bld Extension to Perform Static Code Analysis with Detekt for Kotlin

License Java bld Release Snapshot GitHub CI

To install the latest version, add the following to the lib/bld/bld-wrapper.properties file:

bld.extension-detekt=com.uwyn.rife2:bld-detekt

For more information, please refer to the extensions documentation.

Check Source Code with Detekt

To check all Kotlin source code located in the project, add the following to your build file:

@BuildCommand(summary = "Checks 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 the 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.

Template Project

There is also a Kotlin Template Project with support for Dokka and the Detekt extensions.