Skip to content

Commit b48464d

Browse files
committed
chore: pass processed files out of plugin
1 parent c91d8b1 commit b48464d

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

internal/mocks/uvclient.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package mocks
22

33
import (
4+
"path"
5+
46
"github.com/rs/zerolog"
57

68
"github.com/snyk/cli-extension-dep-graph/internal/uv"
@@ -18,9 +20,12 @@ func (m *MockUVClient) ExportSBOM(inputDir string) (*scaplugin.Finding, error) {
1820
return m.ExportSBOMFunc(inputDir)
1921
}
2022
return &scaplugin.Finding{
21-
Sbom: []byte(`{"mock":"sbom"}`),
22-
TargetFile: "",
23-
FilesProcessed: []string{},
23+
Sbom: []byte(`{"mock":"sbom"}`),
24+
FilesProcessed: []string{
25+
path.Join(inputDir, uv.RequirementsTxtFileName),
26+
path.Join(inputDir, uv.PyprojectTomlFileName),
27+
},
28+
TargetFile: path.Join(inputDir, uv.UvLockFileName),
2429
}, nil
2530
}
2631

internal/uv/uv.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ import (
88
"github.com/rs/zerolog"
99
)
1010

11-
const UvLockFileName = "uv.lock"
11+
const (
12+
UvLockFileName = "uv.lock"
13+
RequirementsTxtFileName = "requirements.txt"
14+
PyprojectTomlFileName = "pyproject.toml"
15+
)
1216

1317
// This is copied from cli-extension-os-flows. We could export from here via GAF config and re-use if this duplication
1418
// becomes a problem, but this duplication is only temporary.

internal/uv/uvclient.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,12 @@ func (c client) ExportSBOM(inputDir string) (*scaplugin.Finding, error) {
5353
}
5454

5555
return &scaplugin.Finding{
56-
Sbom: output,
57-
FilesProcessed: []string{},
58-
TargetFile: path.Join(inputDir, UvLockFileName),
56+
Sbom: output,
57+
FilesProcessed: []string{
58+
path.Join(inputDir, RequirementsTxtFileName),
59+
path.Join(inputDir, PyprojectTomlFileName),
60+
},
61+
TargetFile: path.Join(inputDir, UvLockFileName),
5962
}, nil
6063
}
6164

0 commit comments

Comments
 (0)