Detekt
Your companion for cleaner kotlin detekt helps you write cleaner kotlin code so you can focus on what matters the most building amazing software. Once you have set up detekt in your project, simply run gradlew detekt. To change the default behaviour of detekt rules, first generate yourself a detekt configuration file by running gradlew.
Use the cli detekt will exit with one of the following exit codes: Detekt requires gradle 6.8.3 or higher. If config validation is enabled, detekt will verify that your configuration file is structured correctly and all first party rule sets, rules and configuration options are valid and not marked as deprecated.
This is the first version of detekt that ships with the detekt-compiler-plugin. The detekt compiler plugin is still experimental, but we're moving it closer to detekt to make it easier to integrate. In addition to the cli output, detekt supports 4 different types of output reporting formats.
This is documentation for detekt 1.21.0, which is no longer actively maintained. It is also possible to prefix the rule id with detekt and/or the ruleset id such as @suppress("detekt:longmethod") or @suppress("complexity:longparameterlist").