Skip to content

Release v2.7.0

Latest

Choose a tag to compare

@elrayle elrayle released this 13 May 12:24
3c1ca93

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

  • add function ValidateAndNormalizeLicensesWithOptions (#149) @elrayle
  • license updates (#146)

Full Changelog: v2.6.0...v2.7.0