Skip to content

Commit

Permalink
Add 0BSD license to licenseTypes and [PypiLicense] (#10092)
Browse files Browse the repository at this point in the history
Part of issue #10058
  • Loading branch information
jNullj authored Apr 17, 2024
1 parent 50646f0 commit b0c6496
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
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

0 comments on commit b0c6496

Please sign in to comment.