Skip to content

Latest commit

 

History

History
28 lines (26 loc) · 10.4 KB

File metadata and controls

28 lines (26 loc) · 10.4 KB

Attributes

Name Type Default Description
name name A unique name for this target.
srcs [Label] Kotlin source code files to analyze.
all_rules bool False Activates all available (even unstable) rules.
auto_correct bool False Allow rules to auto correct code if they support it. The default rule sets do NOT support auto correcting and won't change any line in the users code base. However custom rules can be written to support auto correcting. The additional 'formatting' rule set, added with '--plugins', does support it and needs this flag.
base_path string "" Specifies a directory as the base path. Currently it impacts all file paths in the formatted reports. File paths in console output and txt report are not affected and remain as absolute paths.
baseline Label None If a baseline xml file is passed in, only new code smells not in the baseline are printed in the console.
build_upon_default_config bool False Preconfigures detekt with a bunch of rules and some opinionated defaults for you. Allows additional provided configurations to override the defaults.
cfgs [Label] [] Path to the config file (path/to/config.yml). Multiple configuration files can be specified.
config_resource string "" Path to the config resource on detekt's classpath (path/to/config.yml).
disable_default_rulesets bool False Disables default rule sets.
excludes [string] [] Globbing patterns describing paths to exclude from the analysis.
html_report bool False Enables / disables the HTML report generation. The report file name is {target_name}_detekt_report.html.
includes [string] [] Globbing patterns describing paths to include in the analysis. Useful in combination with 'excludes' patterns.
jvm_target string "1.8" EXPERIMENTAL: Target version of the generated JVM bytecode that was generated during compilation and is now being used for type resolution (1.8, 9, 10, ..., 20)
language_version string "" EXPERIMENTAL: Compatibility mode for Kotlin language version X.Y, reports errors for all language features that came out later
max_issues int -1 Passes only when found issues count does not exceed specified issues count.
md_report bool False Enables / disables the Markdown report generation. The report file name is {target_name}_detekt_report.md.
parallel bool False Enables parallel compilation and analysis of source files. Do some benchmarks first before enabling this flag. Heuristics show performance benefits starting from 2000 lines of Kotlin code.
plugins [Label] [] Extra paths to plugin jars.
sarif_report bool False Enables / disables the SARIF report generation. The report file name is {target_name}_detekt_report.sarif.
txt_report bool False Enables / disables the text report generation. The report file name is {target_name}_detekt_report.txt.
xml_report bool False Enables / disables the XML report generation. The report file name is {target_name}_detekt_report.xml. FYI Detekt uses the Checkstyle XML reporting format which makes it compatible with tools like SonarQube.