-
Notifications
You must be signed in to change notification settings - Fork 370
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
feat: allow explicitly ignoring the license of a package in config #1243
Conversation
59929c6
to
79cc657
Compare
79cc657
to
5d8ae74
Compare
cmd/osv-scanner/fixtures/osv-scanner-complex-licenses-config.toml
Outdated
Show resolved
Hide resolved
docs/configuration.md
Outdated
ignore = true # Ignore this package completely, including license scanning | ||
license.ignore = true # Ignore the license of the package, if it is not already completely ignored at the top level | ||
license.override = ["MIT", "0BSD"] # Override the license of the package, if it is not completely ignored at the top level |
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.
note: I've purposely kept the documentation here light as I think it'll be easier to document once #1226 is landed
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1243 +/- ##
==========================================
- Coverage 67.83% 67.82% -0.02%
==========================================
Files 174 174
Lines 16769 16773 +4
==========================================
+ Hits 11375 11376 +1
- Misses 4765 4767 +2
- Partials 629 630 +1 ☔ View full report in Codecov by Sentry. |
@G-Rath I am a bit confused about what this PR does - could you update the description with more details? |
@cuixq I've added a short description, though I think the linked issue gives context too - let me know if there's anything specific you're still confused on that you'd like me to clarify |
cmd/osv-scanner/fixtures/osv-scanner-complex-licenses-config.toml
Outdated
Show resolved
Hide resolved
docs/configuration.md
Outdated
license.override = ["MIT", "0BSD"] # Override the license of the package, if it is not ignored | ||
ignore = true # Ignore this package completely, including license scanning | ||
license.ignore = true # Ignore the license of the package, if it is not already completely ignored at the top level | ||
license.override = ["MIT", "0BSD"] # Override the license of the package, if it is not completely ignored at the top level |
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.
license.override = ["MIT", "0BSD"] # Override the license of the package, if it is not completely ignored at the top level | |
license.override = ["MIT", "0BSD"] # Override the license of the package, if it is not completely ignored |
I think this should be updated now that ignore takes priority.
This allows you to configure the scanner to completely ignore the license of a package in a way that is explicit, as oppose to configuring
license.overrides
to set the package license to an allowed one.Resolves #1124