From 798a406a40b5f657f3d435e4e59b3ab43cfd9e77 Mon Sep 17 00:00:00 2001 From: ProgHaj Date: Wed, 13 Sep 2023 10:57:21 +0200 Subject: [PATCH 1/3] Add new test with default full path --- internal/file/finder_test.go | 5 +++++ internal/file/testdata/test/test-file | 0 2 files changed, 5 insertions(+) create mode 100644 internal/file/testdata/test/test-file diff --git a/internal/file/finder_test.go b/internal/file/finder_test.go index bd3eb6c3..0317cfdc 100644 --- a/internal/file/finder_test.go +++ b/internal/file/finder_test.go @@ -215,6 +215,11 @@ func TestExclude(t *testing.T) { exclusions: []string{"**/yarn/**"}, expectedExclusions: []string{"yarn", "yarn.lock"}, }, + { + name: "TestDirectoryExclusionWithDoublestar", + exclusions: []string{"testdata/test/**"}, + expectedExclusions: []string{"test", "test-file"}, + }, } for _, c := range cases { diff --git a/internal/file/testdata/test/test-file b/internal/file/testdata/test/test-file new file mode 100644 index 00000000..e69de29b From 9506fed5f4c114ebbd85f135bbb19b50ddc0cfa7 Mon Sep 17 00:00:00 2001 From: ProgHaj Date: Wed, 13 Sep 2023 11:14:53 +0200 Subject: [PATCH 2/3] Remove implementation of real package.json in finder testdata --- internal/file/testdata/misc/package.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/internal/file/testdata/misc/package.json b/internal/file/testdata/misc/package.json index 243b6802..e69de29b 100644 --- a/internal/file/testdata/misc/package.json +++ b/internal/file/testdata/misc/package.json @@ -1,5 +0,0 @@ -{ - "dependencies": { - "chart.js": "^2.9.3" - } -} From c062bedc3f971cfb7e206614e39cdc6262d1d73c Mon Sep 17 00:00:00 2001 From: ProgHaj Date: Wed, 13 Sep 2023 11:43:17 +0200 Subject: [PATCH 3/3] Include testdata as part of glob-pattern when scanning the repository --- .github/workflows/debricked.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/debricked.yml b/.github/workflows/debricked.yml index 43244fab..047b2678 100644 --- a/.github/workflows/debricked.yml +++ b/.github/workflows/debricked.yml @@ -24,4 +24,4 @@ jobs: restore-keys: | ${{ runner.os }}-go- - run: | - go run cmd/debricked/main.go scan -t ${{ secrets.DEBRICKED_TOKEN }} -e "pkg/**" -e "test/**" + go run cmd/debricked/main.go scan -t ${{ secrets.DEBRICKED_TOKEN }} -e "pkg/**" -e "test/**" -e "**/testdata/**"