Skip to content

Commit

Permalink
test: remove unneeded exceptions and aliases from license validator
Browse files Browse the repository at this point in the history
The `fs-monkey`, `memfs` and `spdx-license-ids` packages all now have valid license
fields and allowed licenses. All three have been removed from the exceptions
list.
Several SPDX license aliases have been removed as they are no longer used
by any dependencies within the project. The aliases only existed due to
previous non-standard SPDX identifiers present in used packages.
Additionally, the license validator automatically handles SPDX combination
syntax and combinations do not need to be listed explicitly.
  • Loading branch information
clydin authored and alan-agius4 committed Nov 2, 2023
1 parent e38e894 commit 64346a5
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions scripts/validate-licenses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,35 +47,21 @@ const allowedLicenses = [
'Unlicense',
'CC0-1.0',
'0BSD',

// Combinations.
'(AFL-2.1 OR BSD-2-Clause)',
];

// Name variations of SPDX licenses that some packages have.
// Licenses not included in SPDX but accepted will be converted to MIT.
const licenseReplacements: { [key: string]: string } = {
// Just a longer string that our script catches. SPDX official name is the shorter one.
'Apache License, Version 2.0': 'Apache-2.0',
'Apache2': 'Apache-2.0',
// Official SPDX identifier has a dash
'Apache 2.0': 'Apache-2.0',
'Apache v2': 'Apache-2.0',
'AFLv2.1': 'AFL-2.1',
// BSD is BSD-2-clause by default.
'BSD': 'BSD-2-Clause',
};

// Specific packages to ignore, add a reason in a comment. Format: package-name@version.
const ignoredPackages = [
// Us.
'@angular/devkit-repo@0.0.0', // Hey, that's us!
// * Development only
'spdx-license-ids@3.0.5', // CC0 but it's content only (index.json, no code) and not distributed.

// * Broken license fields
'pako@1.0.11', // MIT but broken license in package.json
'fs-monkey@1.0.1', // Unlicense but missing license field (PR: https://github.com/streamich/fs-monkey/pull/209)
'memfs@3.2.0', // Unlicense but missing license field (PR: https://github.com/streamich/memfs/pull/594)
];

// Ignore own packages (all MIT)
Expand Down

0 comments on commit 64346a5

Please sign in to comment.