forked from MapComplete/MapComplete
Merge branch 'fix/licenses' into develop
This commit is contained in:
commit
7d56755660
14 changed files with 101 additions and 324 deletions
|
@ -279,7 +279,23 @@ function main(args: string[]) {
|
|||
const invalidLicenses = licenseInfos
|
||||
.filter((l) => (l.license ?? "") === "")
|
||||
.map((l) => `License for artwork ${l.path} is empty string or undefined`)
|
||||
|
||||
let invalid = 0
|
||||
for (const licenseInfo of licenseInfos) {
|
||||
const isTrivial =
|
||||
licenseInfo.license
|
||||
.split(";")
|
||||
.map((l) => l.trim().toLowerCase())
|
||||
.indexOf("trivial") >= 0
|
||||
if (licenseInfo.sources.length + licenseInfo.authors.length == 0 && !isTrivial) {
|
||||
invalid++
|
||||
invalidLicenses.push(
|
||||
"Invalid license: No sources nor authors given in the license for " +
|
||||
JSON.stringify(licenseInfo)
|
||||
)
|
||||
continue
|
||||
}
|
||||
|
||||
for (const source of licenseInfo.sources) {
|
||||
if (source == "") {
|
||||
invalidLicenses.push(
|
||||
|
@ -294,7 +310,7 @@ function main(args: string[]) {
|
|||
}
|
||||
}
|
||||
|
||||
if (missingLicenses.length > 0) {
|
||||
if (missingLicenses.length > 0 || invalidLicenses.length) {
|
||||
const msg = `There are ${missingLicenses.length} licenses missing and ${invalidLicenses.length} invalid licenses.`
|
||||
console.log(missingLicenses.concat(invalidLicenses).join("\n"))
|
||||
console.error(msg)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue