From ca11e793f4563318673a21daf5db526e97d6674e Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 22 Dec 2022 04:24:46 +0100 Subject: [PATCH] Add more licenses, ignore 'trivial' items --- assets/svg/license_info.json | 20 +------------------ .../charging_stations/license_info.json | 9 +++++++-- scripts/generateLicenseInfo.ts | 11 +++++++--- 3 files changed, 16 insertions(+), 24 deletions(-) diff --git a/assets/svg/license_info.json b/assets/svg/license_info.json index 9ea9f7844..a9da4d4b3 100644 --- a/assets/svg/license_info.json +++ b/assets/svg/license_info.json @@ -499,12 +499,6 @@ "https://www.iconpacks.net/free-icon-pack/gender-107.html" ] }, - { - "path": "gender_female.svg", - "license": "CC0", - "authors": [], - "sources": [] - }, { "path": "gender_female.svg", "license": "CC0", @@ -525,12 +519,6 @@ "https://www.iconpacks.net/free-icon-pack/gender-107.html" ] }, - { - "path": "gender_male.svg", - "license": "CC0", - "authors": [], - "sources": [] - }, { "path": "gender_male.svg", "license": "CC0", @@ -551,12 +539,6 @@ "https://www.iconpacks.net/free-icon-pack/gender-107.html" ] }, - { - "path": "gender_trans.svg", - "license": "CC0", - "authors": [], - "sources": [] - }, { "path": "gender_trans.svg", "license": "CC0", @@ -891,7 +873,7 @@ }, { "path": "none.svg", - "license": "CC0", + "license": "trivial", "authors": [], "sources": [] }, diff --git a/assets/themes/charging_stations/license_info.json b/assets/themes/charging_stations/license_info.json index d254afc9e..58aeb1bc4 100644 --- a/assets/themes/charging_stations/license_info.json +++ b/assets/themes/charging_stations/license_info.json @@ -13,8 +13,13 @@ { "path": "car.svg", "license": "CC0", - "authors": [], - "sources": [] + "authors": [ + "Simon Child", + "The Noun Project" + ], + "sources": [ + "https://thenounproject.com/icon/electric-car-55511/" + ] }, { "path": "logo.svg", diff --git a/scripts/generateLicenseInfo.ts b/scripts/generateLicenseInfo.ts index 5fbf819e7..30b26cd60 100644 --- a/scripts/generateLicenseInfo.ts +++ b/scripts/generateLicenseInfo.ts @@ -282,11 +282,16 @@ function main(args: string[]) { let invalid = 0 for (const licenseInfo of licenseInfos) { - - if(licenseInfo.sources.length + licenseInfo.authors.length == 0){ + 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) + "Invalid license: No sources nor authors given in the license for " + + JSON.stringify(licenseInfo) ) continue }