From 0c988d43dbb783d8fa9dcd64d4dae36d19df23e9 Mon Sep 17 00:00:00 2001 From: klaradebricked Date: Tue, 28 May 2024 09:06:29 +0200 Subject: [PATCH 1/2] filter out .nycrc, .jshintrc and .tm_properties --- internal/fingerprint/exclusion.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/fingerprint/exclusion.go b/internal/fingerprint/exclusion.go index c3be3e2b..d2b74bee 100644 --- a/internal/fingerprint/exclusion.go +++ b/internal/fingerprint/exclusion.go @@ -33,6 +33,7 @@ var defaultFingerprintExclusions = DefaultFingerprintExclusionList{ "gradlew", "gradlew.bat", "mvnw", "mvnw.cmd", "gradle-wrapper.jar", "maven-wrapper.jar", "thumbs.db", "babel.config.js", "license.txt", "license.md", "copying.lib", "makefile", "\\[content_types\\].xml", "\\[Content_Types\\].xml", "py.typed", "LICENSE.APACHE2", "LICENSE.MIT", + ".nycrc", ".jshintrc", ".tm_properties", }, Endings: []string{ "-doc", "changelog", "config", "copying", "license", "authors", "news", "licenses", "notice", From a8ee26e81c18ec036528dff5162006abcd17c394 Mon Sep 17 00:00:00 2001 From: klaradebricked Date: Tue, 28 May 2024 10:20:13 +0200 Subject: [PATCH 2/2] add additional files to exclude --- internal/fingerprint/exclusion.go | 4 +++- internal/fingerprint/fingerprint_test.go | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/internal/fingerprint/exclusion.go b/internal/fingerprint/exclusion.go index d2b74bee..2f3a8308 100644 --- a/internal/fingerprint/exclusion.go +++ b/internal/fingerprint/exclusion.go @@ -33,7 +33,9 @@ var defaultFingerprintExclusions = DefaultFingerprintExclusionList{ "gradlew", "gradlew.bat", "mvnw", "mvnw.cmd", "gradle-wrapper.jar", "maven-wrapper.jar", "thumbs.db", "babel.config.js", "license.txt", "license.md", "copying.lib", "makefile", "\\[content_types\\].xml", "\\[Content_Types\\].xml", "py.typed", "LICENSE.APACHE2", "LICENSE.MIT", - ".nycrc", ".jshintrc", ".tm_properties", + ".nycrc", ".jshintrc", ".tm_properties", "webpack.config.js", "eslint.config.js", + "eslint.config.mjs", "eslint.config.cjs", ".eslintrc.yaml", ".eslintrc.js", ".eslintrc.mjs", + ".eslintrc.cjs", "jest.config.js", "vite.config.mjs", "vite.config.js", ".resx", }, Endings: []string{ "-doc", "changelog", "config", "copying", "license", "authors", "news", "licenses", "notice", diff --git a/internal/fingerprint/fingerprint_test.go b/internal/fingerprint/fingerprint_test.go index 26baab33..1a687f22 100644 --- a/internal/fingerprint/fingerprint_test.go +++ b/internal/fingerprint/fingerprint_test.go @@ -106,6 +106,22 @@ func TestShouldProcessFile(t *testing.T) { mock: func() { errorString = "generic error" }, want: false, }, + { + name: "Test excluded file", + filePath: testFile, + excludes: []string{"foo/webpack.config.js"}, + includes: []string{}, + mock: func() {}, + want: false, + }, + { + name: "Test excluded file", + filePath: testFile, + excludes: []string{".tm_properties"}, + includes: []string{}, + mock: func() {}, + want: false, + }, } for _, tt := range tests {