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(php): skip composer.lock
inside vendor
folder
#2718
Conversation
@@ -25,6 +26,21 @@ var requiredFiles = []string{types.ComposerLock} | |||
type composerLibraryAnalyzer struct{} | |||
|
|||
func (a composerLibraryAnalyzer) Analyze(_ context.Context, input analyzer.AnalysisInput) (*analyzer.AnalysisResult, error) { | |||
// we should skip `composer.lock` inside `vendor` folder |
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 should do that in Required
.
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.
sure, done
if s == "vendor" { | ||
path := filepath.Join(subDirs[:i]...) | ||
f := filepath.Join(path, file) | ||
if _, err := os.Stat(f); err == os.ErrNotExist { |
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.
os.Stat
doesn't work if it is from a tar file.
Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
Description
trivy
scanscomposer.lock
files in the vendor folder, but these don't reflect what is really installed.composer.lock
files in the vendor folder should be ignored.before:
after:
Related issues
Checklist