Skip to content
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

Add 0BSD license to licenseTypes and [PypiLicense] #10092

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion services/licenses.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const licenseTypes = {
},
// public domain licenses do not require 'License and copyright notice' (https://choosealicense.com/appendix/#include-copyright)
'public-domain': {
spdxLicenseIds: ['CC0-1.0', 'Unlicense', 'WTFPL'],
spdxLicenseIds: ['CC0-1.0', 'Unlicense', 'WTFPL', '0BSD'],
aliases: ['CC0'],
color: '7cd958',
priority: '3',
Expand Down
2 changes: 1 addition & 1 deletion services/licenses.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe('license helpers', function () {
test(licenseToColor, () => {
forCases([given('MIT'), given('BSD')]).expect('green')
forCases([given('MPL-2.0'), given('MPL')]).expect('orange')
forCases([given('Unlicense'), given('CC0')]).expect('7cd958')
forCases([given('Unlicense'), given('CC0'), given('0BSD')]).expect('7cd958')
forCases([given('unknown-license'), given(null)]).expect('lightgrey')

given(['CC0-1.0', 'MPL-2.0']).expect('7cd958')
Expand Down
1 change: 1 addition & 0 deletions services/pypi/pypi-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ function getLicenses(packageData) {
'OSI Approved :: Apache Software License': 'Apache-2.0',
'CC0 1.0 Universal (CC0 1.0) Public Domain Dedication': 'CC0-1.0',
'OSI Approved :: GNU Affero General Public License v3': 'AGPL-3.0',
'OSI Approved :: Zero-Clause BSD (0BSD)': '0BSD',
}
let licenses = parseClassifiers(packageData, /^License :: (.+)$/, true)
.map(classifier =>
Expand Down
6 changes: 6 additions & 0 deletions services/pypi/pypi-helpers.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,12 @@ describe('PyPI helpers', function () {
],
},
}).expect(['AGPL-3.0'])
given({
info: {
license: '',
classifiers: ['License :: OSI Approved :: Zero-Clause BSD (0BSD)'],
},
}).expect(['0BSD'])
})

test(getPackageFormats, () => {
Expand Down
Loading