Skip to content
Snippets Groups Projects
Unverified Commit 4da9e7d5 authored by chris48s's avatar chris48s Committed by GitHub
Browse files

fall back to classifiers if license text is really long (#8690)

parent affae9c5
Branches
Tags
No related merge requests found
...@@ -50,7 +50,7 @@ function getLicenses(packageData) { ...@@ -50,7 +50,7 @@ function getLicenses(packageData) {
const { const {
info: { license }, info: { license },
} = packageData } = packageData
if (license) { if (license && license.length < 40) {
return [license] return [license]
} else { } else {
const parenthesizedAcronymRegex = /\(([^)]+)\)/ const parenthesizedAcronymRegex = /\(([^)]+)\)/
......
...@@ -116,6 +116,13 @@ describe('PyPI helpers', function () { ...@@ -116,6 +116,13 @@ describe('PyPI helpers', function () {
classifiers: ['License :: OSI Approved :: MIT License'], classifiers: ['License :: OSI Approved :: MIT License'],
}, },
}), }),
given({
info: {
license:
'this text is really really really really really really long',
classifiers: ['License :: OSI Approved :: MIT License'],
},
}),
given({ given({
info: { info: {
license: '', license: '',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment