-
Notifications
You must be signed in to change notification settings - Fork 369
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support composite-based package overrides (#1214)
This rewrites the package overrides logic to be composition based, granting a lot more flexibility: ``` # ignore everything [[PackageOverrides]] ignore = true # ignore everything in this group [[PackageOverrides]] group = "dev" ignore = true # ignore everything in this ecosystem [[PackageOverrides]] ecosystem = "go" ignore = true # ignore all packages named "axios" regardless of ecosystem or group [[PackageOverrides]] name = "axios" ignore = true # ignore all packages named "axios" in the npm ecosystem that are in the dev group [[PackageOverrides]] name = "axios" ecosystem = "npm" group = "dev" ignore = true # ... and so on ``` While some of these might seem a bit extreme, ultimately I think this is probably the way to go as the logic itself is very straightforward and it gives a lot more power to the people. Since `config` is a public package, I've had to deprecated the related existing public methods and there's a bit of naming & structural yuck but I figure that's not a big deal since v2 is right around the corner and again the logic itself is very straightforward. Resolves #1211 Resolves #1155
- Loading branch information
Showing
8 changed files
with
719 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
cmd/osv-scanner/fixtures/osv-scanner-composite-config.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[[PackageOverrides]] | ||
ecosystem = "npm" | ||
ignore = true | ||
|
||
[[PackageOverrides]] | ||
ecosystem = "Packagist" | ||
license.override = ["0BSD"] | ||
|
||
[[PackageOverrides]] | ||
ecosystem = "Alpine" | ||
license.override = ["MIT"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.