From cac7f2e904f005e14a5d44d2a19b79bbbd466b80 Mon Sep 17 00:00:00 2001 From: ravikumarsinghshankarsingh <80386988+ravikumarsinghshankarsingh@users.noreply.github.com> Date: Wed, 19 May 2021 14:57:49 +0200 Subject: [PATCH] =?UTF-8?q?"ignoreSourceFiles"=20parameter=20removed=20fro?= =?UTF-8?q?m=20general=20section=20and=20added=20=E2=80=A6=20(#2814)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * "ignoreSourceFiles" parameter removed from general section and added to specific build tool section * Update configHelper_test.go Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com> --- pkg/whitesource/configHelper.go | 9 ++++++++- pkg/whitesource/configHelper_test.go | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pkg/whitesource/configHelper.go b/pkg/whitesource/configHelper.go index d91dfff40..fa170fa29 100644 --- a/pkg/whitesource/configHelper.go +++ b/pkg/whitesource/configHelper.go @@ -134,7 +134,6 @@ func (c *ConfigOptions) addGeneralDefaults(config *ScanOptions, utils Utils, pro {Name: "userKey", Value: config.UserToken, Force: true}, {Name: "forceUpdate", Value: true, Force: true}, {Name: "offline", Value: false, Force: true}, - {Name: "ignoreSourceFiles", Value: true, Force: true}, {Name: "resolveAllDependencies", Value: false, Force: true}, {Name: "failErrorLevel", Value: "ALL", Force: true}, {Name: "case.sensitive.glob", Value: false}, @@ -159,20 +158,24 @@ func (c *ConfigOptions) addBuildToolDefaults(config *ScanOptions, utils Utils) e {Name: "docker.excludeBaseImage", Value: "true", Force: false}, }, "dub": { + {Name: "ignoreSourceFiles", Value: true, Force: true}, {Name: "includes", Value: "**/*.d **/*.di"}, }, //ToDo: rename to go? //ToDo: switch to gomod as dependency manager "golang": { + {Name: "ignoreSourceFiles", Value: true, Force: true}, {Name: "go.resolveDependencies", Value: true, Force: true}, {Name: "go.ignoreSourceFiles", Value: true, Force: true}, {Name: "go.collectDependenciesAtRuntime", Value: false}, {Name: "go.dependencyManager", Value: "modules"}, }, "gradle": { + {Name: "ignoreSourceFiles", Value: true, Force: true}, {Name: "gradle.localRepositoryPath", Value: ".gradle", Force: false}, }, "maven": { + {Name: "ignoreSourceFiles", Value: true, Force: true}, {Name: "updateEmptyProject", Value: true, Force: true}, {Name: "maven.resolveDependencies", Value: true, Force: true}, {Name: "maven.ignoreSourceFiles", Value: true, Force: true}, @@ -186,6 +189,7 @@ func (c *ConfigOptions) addBuildToolDefaults(config *ScanOptions, utils Utils) e {Name: "excludes", Value: "**/*sources.jar **/*javadoc.jar"}, }, "npm": { + {Name: "ignoreSourceFiles", Value: true, Force: true}, {Name: "npm.resolveDependencies", Value: true, Force: true}, {Name: "npm.ignoreSourceFiles", Value: true, Force: true}, {Name: "npm.ignoreNpmLsErrors", Value: true}, @@ -195,6 +199,7 @@ func (c *ConfigOptions) addBuildToolDefaults(config *ScanOptions, utils Utils) e {Name: "npm.resolveLockFile", Value: true}, }, "pip": { + {Name: "ignoreSourceFiles", Value: true, Force: true}, {Name: "python.resolveDependencies", Value: true, Force: true}, {Name: "python.ignoreSourceFiles", Value: true, Force: true}, {Name: "python.ignorePipInstallErrors", Value: false}, @@ -209,6 +214,7 @@ func (c *ConfigOptions) addBuildToolDefaults(config *ScanOptions, utils Utils) e {Name: "excludes", Value: "**/*sources.jar **/*javadoc.jar"}, }, "sbt": { + {Name: "ignoreSourceFiles", Value: true, Force: true}, {Name: "sbt.resolveDependencies", Value: true, Force: true}, {Name: "sbt.ignoreSourceFiles", Value: true, Force: true}, {Name: "sbt.aggregateModules", Value: false, Force: true}, @@ -217,6 +223,7 @@ func (c *ConfigOptions) addBuildToolDefaults(config *ScanOptions, utils Utils) e {Name: "excludes", Value: "**/*sources.jar **/*javadoc.jar"}, }, "yarn": { + {Name: "ignoreSourceFiles", Value: true, Force: true}, {Name: "npm.resolveDependencies", Value: true, Force: true}, {Name: "npm.ignoreSourceFiles", Value: true, Force: true}, {Name: "npm.yarnProject", Value: true, Force: true}, diff --git a/pkg/whitesource/configHelper_test.go b/pkg/whitesource/configHelper_test.go index 5fbb66be4..dc453b829 100644 --- a/pkg/whitesource/configHelper_test.go +++ b/pkg/whitesource/configHelper_test.go @@ -181,7 +181,7 @@ func TestAddBuildToolDefaults(t *testing.T) { } err := testConfig.addBuildToolDefaults(&whitesourceConfig, utilsMock) assert.NoError(t, err) - assert.Equal(t, ConfigOptions{{Name: "includes", Value: "**/*.d **/*.di"}}, testConfig) + assert.Equal(t, ConfigOptions{{Name: "ignoreSourceFiles", Value: true, Force: true}, {Name: "includes", Value: "**/*.d **/*.di"}}, testConfig) }) t.Run("error case", func(t *testing.T) {