-
Notifications
You must be signed in to change notification settings - Fork 598
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 3626 add option enable license content; disable by default (#3631)
--------- Signed-off-by: Christopher Phillips <[email protected]>
- Loading branch information
Showing
25 changed files
with
418 additions
and
80 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package options | ||
|
||
import ( | ||
"github.com/anchore/clio" | ||
) | ||
|
||
type licenseConfig struct { | ||
IncludeUnknownLicenseContent bool `yaml:"include-unknown-license-content" json:"include-unknown-license-content" mapstructure:"include-unknown-license-content"` | ||
LicenseCoverage float64 `yaml:"license-coverage" json:"license-coverage" mapstructure:"license-coverage"` | ||
} | ||
|
||
var _ interface { | ||
clio.FieldDescriber | ||
} = (*licenseConfig)(nil) | ||
|
||
func (o *licenseConfig) DescribeFields(descriptions clio.FieldDescriptionSet) { | ||
descriptions.Add(&o.IncludeUnknownLicenseContent, `include the content of a license in the SBOM when syft | ||
cannot determine a valid SPDX ID for the given license`) | ||
descriptions.Add(&o.LicenseCoverage, `adjust the percent as a fraction of the total text, in normalized words, that | ||
matches any valid license for the given inputs, expressed as a percentage across all of the licenses matched.`) | ||
} | ||
|
||
func defaultLicenseConfig() licenseConfig { | ||
return licenseConfig{ | ||
IncludeUnknownLicenseContent: false, | ||
LicenseCoverage: 75, | ||
} | ||
} |
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
Oops, something went wrong.