File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
dependency/parser/python/uv
fanal/analyzer/language/python/uv Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -100,9 +100,13 @@ type Dependency struct {
100
100
Name string `toml:"name"`
101
101
}
102
102
103
- type lockParser struct {}
103
+ type Parser struct {}
104
104
105
- func (p * lockParser ) Parse (r xio.ReadSeekerAt ) ([]ftypes.Package , []ftypes.Dependency , error ) {
105
+ func New () * Parser {
106
+ return & Parser {}
107
+ }
108
+
109
+ func (p * Parser ) Parse (r xio.ReadSeekerAt ) ([]ftypes.Package , []ftypes.Dependency , error ) {
106
110
var lock Lock
107
111
if _ , err := toml .NewDecoder (r ).Decode (& lock ); err != nil {
108
112
return nil , nil , xerrors .Errorf ("failed to decode uv lock file: %w" , err )
Original file line number Diff line number Diff line change 9
9
10
10
"golang.org/x/xerrors"
11
11
12
+ uvparser "github.com/aquasecurity/trivy/pkg/dependency/parser/python/uv"
12
13
"github.com/aquasecurity/trivy/pkg/fanal/analyzer"
13
14
"github.com/aquasecurity/trivy/pkg/fanal/analyzer/language"
14
15
"github.com/aquasecurity/trivy/pkg/fanal/types"
@@ -27,7 +28,7 @@ type uvAnalyzer struct {
27
28
28
29
func NewUvAnalyzer (_ analyzer.AnalyzerOptions ) (analyzer.PostAnalyzer , error ) {
29
30
return & uvAnalyzer {
30
- lockParser : & lockParser {} ,
31
+ lockParser : uvparser . New () ,
31
32
}, nil
32
33
}
33
34
You can’t perform that action at this time.
0 commit comments