From 0d397ff0a6e7f50e28b2a95fe13c967d148e4da5 Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Mon, 22 Jan 2024 14:32:37 +0100 Subject: [PATCH] fix(scancode): Move `--strip-root` to non-config options Whether the root path is stripped from the file paths for findings does not have an impact on scan results anymore because file paths are relativized for all scanners as of 6e68575. Signed-off-by: Sebastian Schuberth --- plugins/scanners/scancode/src/main/kotlin/ScanCodeConfig.kt | 2 +- plugins/scanners/scancode/src/test/kotlin/ScanCodeTest.kt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/scanners/scancode/src/main/kotlin/ScanCodeConfig.kt b/plugins/scanners/scancode/src/main/kotlin/ScanCodeConfig.kt index 60bf0458b1f9e..d182583825e03 100644 --- a/plugins/scanners/scancode/src/main/kotlin/ScanCodeConfig.kt +++ b/plugins/scanners/scancode/src/main/kotlin/ScanCodeConfig.kt @@ -43,7 +43,6 @@ data class ScanCodeConfig( "--copyright", "--license", "--info", - "--strip-root", "--timeout ${DEFAULT_TIMEOUT.inWholeSeconds}" ) @@ -52,6 +51,7 @@ data class ScanCodeConfig( */ private val DEFAULT_COMMAND_LINE_NON_CONFIG_OPTIONS = listOf( "--json-pp", + "--strip-root", "--processes", max(1, Runtime.getRuntime().availableProcessors() - 1).toString() ) diff --git a/plugins/scanners/scancode/src/test/kotlin/ScanCodeTest.kt b/plugins/scanners/scancode/src/test/kotlin/ScanCodeTest.kt index 313d1dcd8f5cb..c39ff913c5922 100644 --- a/plugins/scanners/scancode/src/test/kotlin/ScanCodeTest.kt +++ b/plugins/scanners/scancode/src/test/kotlin/ScanCodeTest.kt @@ -43,7 +43,7 @@ class ScanCodeTest : WordSpec({ "configuration" should { "return the default values if the scanner configuration is empty" { - scanner.configuration shouldBe "--copyright --license --info --strip-root --timeout 300" + scanner.configuration shouldBe "--copyright --license --info --timeout 300" } "return the non-config values from the scanner configuration" { @@ -63,9 +63,9 @@ class ScanCodeTest : WordSpec({ "getCommandLineOptions()" should { "contain the default values if the scanner configuration is empty" { scanner.getCommandLineOptions("31.2.4").joinToString(" ") shouldMatch - "--copyright --license --info --strip-root --timeout 300 --json-pp --processes \\d+" + "--copyright --license --info --timeout 300 --json-pp --strip-root --processes \\d+" scanner.getCommandLineOptions("32.0.0").joinToString(" ") shouldMatch - "--copyright --license --info --strip-root --timeout 300 --json-pp --processes \\d+ " + + "--copyright --license --info --timeout 300 --json-pp --strip-root --processes \\d+ " + "--license-references" }