Overview
This release makes one changes:
- new validation function that returns the normalized/deduped list of valid licenses
validate, normalize, and dedup licenses
A new function was added, ValidateAndNormalizeLicensesWithOptions. It is functionally equivalent to ValidateLicensesWithOptions with options:
- FailComplexExpressions - rejects license that includes a conjunctive (e.g. "MIT AND Apache-2.0")
- FailDeprecatedLicenses - rejects deprecated SPDX license identifiers (e.g. "eCos-2.0")
- FailAllLicenseRefs - rejects all SPDX license references (e.g. "LicenseRef-MyLicense")
- FailAllDocumentRefs - rejects all SPDX document references (e.g. "DocumentRef-MyDocument")
ValidateLicensesWithOptions returns a boolean indicating whether all licenses are valid (i.e. true) or one of more are invalid (i.e. false). It also returns a list of any licenses that were invalid.
ValidateAndNormalizeLicensesWithOptions does not return a boolean. It returns 2 lists. The first is the list of normalized valid licenses that have been deduped. The second is a list of of any licenses that were invalid. If the invalid list is empty, then all licenses are valid.
Normalization and Deduping
licenses: `"mit", "apache-2.0"`
normalized: `"MIT", "Apache-2.0"`
licenses: `"mit", "MIT", " MIT ", "apache-2.0"`
normalized: `MIT, Apache-2.0`
What's Changed
Full Changelog: v2.6.0...v2.7.0