Skip to content

bld extension to perform static code analysis with Detekt for Kotlin

Notifications You must be signed in to change notification settings

rife2/bld-detekt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 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.