detekt

Static code analysis for Kotlin.

Version

1.2.2

Runtime

OpenJDK 8

Supported Languages

Kotlin

Official Documentation

https://arturbosch.github.io/detekt/

YAML Configuration

detekt:

  • config-file:

    Alias of --config option.

  • machine:

    • cpu:

      Amount of CPU. The default machine has 0.5 CPU with 1920 MiB RAM.

  • options:

      --baseline, -b
        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
        Preconfigures detekt with a bunch of rules and some opinionated defaults
        for you. Allows additional provided configurations to override the
        defaults.
        Default: false
      --classpath, -cp
        EXPERIMENTAL: Paths where to find user class files and depending jar
        files. Used for type resolution.
      --config, -c
        Path to the config file (path/to/config.yml). Multiple configuration
        files can be specified with ',' or ';' as separator.
      --config-resource, -cr
        Path to the config resource on detekt's classpath (path/to/config.yml).
      --disable-default-rulesets, -dd
        Disables default rule sets.
        Default: false
      --excludes, -ex
        Globing patterns describing paths to exclude from the analysis.
      --includes, -in
        Globing patterns describing paths to include in the analysis. Useful in
        combination with 'excludes' patterns.
      --input, -i
        Input paths to analyze. Multiple paths are separated by comma. If not
        specified the current working directory is used.
      --jvm-target
        EXPERIMENTAL: Target version of the generated JVM bytecode that was
        generated during compilation and is now being used for type resolution
        (1.6, 1.8, 9, 10, 11 or 12)
        Default: JVM_1_6
        Possible Values: [JVM_1_6, JVM_1_8, JVM_9, JVM_10, JVM_11, JVM_12]
      --language-version
        EXPERIMENTAL: Compatibility mode for Kotlin language version X.Y,
        reports errors for all language features that came out later (1.0, 1.1,
        1.2, 1.3, 1.4)
        Possible Values: [1.0, 1.1, 1.2, 1.3, 1.4]
      --plugins, -p
        Extra paths to plugin jars separated by ',' or ';'.
    

YAML Examples

  • With default options:

    inspecode:
      tools:
        detekt: default
    
  • With enabling auto-fixing and default options:

    inspecode:
      tools:
        detekt: auto-fix
    
  • With custom machine:

    inspecode:
      tools:
        detekt:
          machine:
            cpu: 1.5 # 1.5 CPU, 5760 MiB RAM
    
  • With custom options:

    inspecode:
      tools:
        detekt:
          options:
            --disable-default-rulesets:
    
  • With a configuration file:

    inspecode:
      tools:
        detekt:
          config-file: ./my/detekt-config.yml
    

    The above configuration is equivalent to:

    inspecode:
      tools:
        detekt:
          options:
            --config: ./my/detekt-config.yml
    

results matching ""

    No results matching ""