bld extension to perform static code analysis with Detekt for Kotlin
https://github.com/rife2/bld-detekt
.github/workflows | ||
.idea | ||
.vscode | ||
examples | ||
lib/bld | ||
src | ||
.gitignore | ||
bld | ||
bld.bat | ||
README.md |
bld Extension to Perform Static Code Analysis with Detekt for Kotlin
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.