-
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.
Signed-off-by: Christopher Phillips <[email protected]>
- Loading branch information
Showing
3 changed files
with
46 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
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", | ||
}, | ||
}, | ||
} | ||
} |