-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: simple list output with new colors (#14)
--------- Signed-off-by: Christopher Phillips <[email protected]>
- Loading branch information
Showing
12 changed files
with
216 additions
and
137 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
#.grant.yaml | ||
show-packages: true | ||
show-packages: false | ||
check-non-spdx: true | ||
format: table | ||
rules: | ||
- pattern: "*gpl*" | ||
name: "gpl-denied" | ||
mode: "deny" | ||
reason: "GPL licenses are not allowed" | ||
exceptions: | ||
- "lib*" | ||
- pattern: "*gfdl*" | ||
mode: "deny" | ||
reason: "GPL licenses are not allowed" | ||
reason: "GPL licenses are not allowed per xxx-xx company policy" | ||
exclusions: | ||
- "alpine-base-layout" # We don't link against this package so we don't care about its license | ||
|
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
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,32 @@ | ||
package option | ||
|
||
import "github.com/anchore/clio" | ||
|
||
type Check struct { | ||
Format string `json:"format" yaml:"format" mapstructure:"format"` | ||
ShowPackages bool `json:"show-packages" yaml:"show-packages" mapstructure:"show-packages"` | ||
CheckNonSPDX bool `json:"check-non-spdx" yaml:"check-non-spdx" mapstructure:"check-non-spdx"` | ||
Quiet bool `json:"quiet" yaml:"quiet" mapstructure:"quiet"` | ||
Rules []Rule `json:"rules" yaml:"rules" mapstructure:"rules"` | ||
} | ||
|
||
func (o *Check) AddFlags(flags clio.FlagSet) { | ||
flags.BoolVarP(&o.ShowPackages, "show-packages", "", "expand the license lists to show packages that contained the license violation") | ||
flags.BoolVarP(&o.CheckNonSPDX, "check-non-spdx", "", "run the configured rules against licenses that could not be matched to the SPDX license list") | ||
} | ||
|
||
func DefaultCheck() Check { | ||
return Check{ | ||
ShowPackages: false, | ||
CheckNonSPDX: false, | ||
Quiet: false, | ||
Rules: []Rule{ | ||
{ | ||
Name: "deny-all", | ||
Reason: "grant by default will deny all licenses", | ||
Pattern: "*", | ||
Severity: "high", | ||
}, | ||
}, | ||
} | ||
} |
Oops, something went wrong.