1
0
mirror of https://github.com/badges/shields.git synced 2025-04-18 19:44:04 +03:00

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

Part of issue #10058
This commit is contained in:
jNullj 2024-04-17 18:36:14 +03:00 committed by GitHub
parent 50646f0f2b
commit b0c649655e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 2 deletions

View File

@ -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',

View File

@ -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')

View File

@ -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 =>

View File

@ -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, () => {