From 838ceb6e63e2dc1dcc72a3bd6c663ed167098761 Mon Sep 17 00:00:00 2001 From: abosch Date: Thu, 23 Mar 2017 23:08:39 +0100 Subject: [PATCH] Fix jcommander specific parameter parsing - #11 --- .../kotlin/io/gitlab/arturbosch/detekt/cli/Main.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/detekt-cli/src/main/kotlin/io/gitlab/arturbosch/detekt/cli/Main.kt b/detekt-cli/src/main/kotlin/io/gitlab/arturbosch/detekt/cli/Main.kt index 927632055f0..381c8c6911d 100644 --- a/detekt-cli/src/main/kotlin/io/gitlab/arturbosch/detekt/cli/Main.kt +++ b/detekt-cli/src/main/kotlin/io/gitlab/arturbosch/detekt/cli/Main.kt @@ -17,7 +17,7 @@ class Main { lateinit var project: Path @Parameter(names = arrayOf("--filters", "-f"), description = "Path filters defined through regex with separator ';' (\".*test.*\").") - val filters: String? = null // Using a converter for List resulted in a ClassCastException + var filters: String? = null // Using a converter for List resulted in a ClassCastException @Parameter(names = arrayOf("--config", "-c"), description = "Path to the config file (path/to/config.yml).", converter = ExistingPathConverter::class) @@ -32,16 +32,16 @@ class Main { var reportDirectory: Path? = null @Parameter(names = arrayOf("--rules", "-r"), description = "Extra paths to ruleset jars separated by ';'.") - val rules: String? = null + var rules: String? = null @Parameter(names = arrayOf("--format"), description = "Enables formatting of source code. Cannot be used together with --config.") - val formatting: Boolean = false + var formatting: Boolean = false @Parameter(names = arrayOf("--parallel"), description = "Enables parallel compilation of source files. Should only be used if the analyzing project has more than ~200 kotlin files.") - val parallel: Boolean = false + var parallel: Boolean = false @Parameter(names = arrayOf("--useTabs"), description = "Tells the formatter that indentation with tabs are valid.") - val useTabs: Boolean = false + var useTabs: Boolean = false @Parameter(names = arrayOf("--baseline", "-b"), description = "Treats current analysis findings as a smell baseline for further detekt runs. If a baseline xml file exists, only new code smells not in the baseline are printed in the console.") var baseline: Boolean = false