Skip to content

Supported tools#

The plugin supports several static analysis tools. The availability of each tool depends on the project the plugin is applied to. Some tools only support Java code, some only Kotlin code, and some only work on Android projects. To be precise:

Tool Java Android
(Java)
Kotlin Android
(Kotlin)
Checkstyle :white_check_mark: :white_check_mark:
PMD :white_check_mark: :white_check_mark:
SpotBugs :white_check_mark: :white_check_mark:
Detekt :white_check_mark: :white_check_mark:
Android Lint :white_check_mark:️ :white_check_mark:️
KtLint :white_check_mark:️ :white_check_mark:️

For additional informations and tips on how to obtain advanced behaviours with the plugin and its tools, please refer to the advanced usage page.

Table of contents#


Enable and disable tools#

In order to enable a tool, you just need to add it to the staticAnalysis closure. To enable all supported tools with their default configurations:

staticAnalysis {
    penalty {
        // ... (optional)
    }

    checkstyle {}
    pmd {}
    spotbugs {}
    lintOptions {}
    detekt {}
    ktlint {}
}

To disable a tool, simply omit its closure from staticAnalysis. This means that, for example, this will not run any tools:

staticAnalysis {
    penalty {
        // ...
    }
}