Skip to main content

detekt

note

This is BETA. The behavior of this tool might change.

Supported VersionLanguageWebsite
1.17.1Kotlinhttps://detekt.github.io/detekt

detekt is a linter which code smell analysis for your Kotlin projects.

Getting Started#

To start using detekt, enable it in your repository settings, and put a configuration in sider.yml.

Using detekt#

You can use detekt without any configuration, but we recommend making a configuration.

Put the detekt key in sider.yml to customize the execution of detekt.

linter:  detekt:    target:      - "src/"      - "test/"    baseline: "baseline.xml"    config:      - "path/to/detekt-config.yml"      - "path/to/another/detekt-config.yml"    config-resource: []    disable-default-rulesets: false    excludes:      - "**/excludes_dir/**"      - "**/another/excludes_dir/**"    includes: []    parallel: true

Configuration#

You can customize your detekt analysis using sider.yml.

NameTypeDefault
root_dirstring-
dependenciesstring[], map[]-
targetstring, string[]-
baselinestring-
configstring, string[][]
config-resourcestring, string[][]
disable-default-rulesetsbooleanfalse
excludesstring, string[][]
includesstring, string[][]
parallelbooleanfalse

For more details about the options, see the official documentation.

target#

This option allows you to specify paths to be analyzed.

alias: input

baseline#

This option allows you to specify a baseline XML file path. If the file is passed, only new code smells not in the baseline are reported.

config#

This option allows you to specify your configuration file(s) path for detekt.

config-resource#

This option allows you to specify the configuration resource path(s) on detekt's classpath.

disable-default-rulesets#

This option allows you to specify whether disables the default rule sets or not.

excludes#

This option allows you to specify glob pattern(s) of paths to exclude from the analysis.

includes#

This option allows you to specify glob pattern(s) of paths to include in the analysis.

parallel#

This option allows you to control if an analysis runs in parallel mode.