Skip to content

Add public domain as a valid license #18443

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions scripts/validate-licenses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const spdxSatisfies = require('spdx-satisfies');
* - Public Domain
* Same as CC0, it is not a valid license.
*/
const licensesWhitelist = [
const allowedLicenses = [
// Regular valid open source licenses supported by Google.
'MIT',
'ISC',
Expand All @@ -43,6 +43,7 @@ const licensesWhitelist = [
'Unlicense',
'CC0-1.0',
'0BSD',
'Public Domain',

// Combinations.
'(AFL-2.1 OR BSD-2-Clause)',
Expand Down Expand Up @@ -114,7 +115,7 @@ export default function (_options: {}, logger: logging.Logger): Promise<number>
.map(x => x.replace(/\*$/, ''))
.map(x => x in licenseReplacements ? licenseReplacements[x] : x),
}))
.filter(pkg => !_passesSpdx(pkg.licenses, licensesWhitelist))
.filter(pkg => !_passesSpdx(pkg.licenses, allowedLicenses))
.filter(pkg => !ignoredPackages.find(ignored => ignored === pkg.id));

// Report packages with bad licenses
Expand Down