Skip to content

Commit

Permalink
fix(scancode): Move --strip-root to non-config options
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
sschuberth committed Jan 24, 2024
1 parent 86b66d5 commit 0d397ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ data class ScanCodeConfig(
"--copyright",
"--license",
"--info",
"--strip-root",
"--timeout ${DEFAULT_TIMEOUT.inWholeSeconds}"
)

Expand All @@ -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()
)

Expand Down
6 changes: 3 additions & 3 deletions plugins/scanners/scancode/src/test/kotlin/ScanCodeTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand All @@ -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"
}

Expand Down

0 comments on commit 0d397ff

Please sign in to comment.