-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: use --file-patterns
flag for all post analyzers
#7365
base: main
Are you sure you want to change the base?
fix: use --file-patterns
flag for all post analyzers
#7365
Conversation
@@ -65,7 +66,7 @@ func (a packagingAnalyzer) PostAnalyze(_ context.Context, input analyzer.PostAna | |||
var apps []types.Application | |||
|
|||
required := func(path string, _ fs.DirEntry) bool { | |||
return filepath.Base(path) == "METADATA" || isEggFile(path) | |||
return filepath.Base(path) == "METADATA" || isEggFile(path) || slices.Contains(input.FilePatterns, path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A file may not end with .egg
if --file-patterns
is specified. But I don't have a simple idea of how to handle that. We may want to ignore the edge case.
if strings.HasSuffix(path, ".egg") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may need to split this analyzer into two analyzers for .egg
and .egg-info
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may need to split this analyzer into two analyzers for .egg and .egg-info.
I agree with this decision.
Split analyzers in afb7387
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make it a separate PR?
pkg/fanal/analyzer/analyzer.go
Outdated
Options AnalysisOptions | ||
FS fs.FS | ||
Options AnalysisOptions | ||
FilePatterns []string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this filed for file patterns? It looks like matched file paths.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated filed name in 5f493ac
Description
Use
--file-patterns
flag for all post analyzers.Related issues
--file-patterns
doesn't work for somepost-analyzers
#6962Checklist