aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/license_headers
diff options
context:
space:
mode:
authorTomasz Kramkowski <tk@the-tk.com>2020-09-09 18:18:43 +0100
committerTomasz Kramkowski <tk@the-tk.com>2020-09-09 18:26:32 +0100
commitbfc2b8d8396a08b7fbd1615ddabe721102323b76 (patch)
tree5b144af3a52627a824fce277170ba6a825c60c92 /scripts/license_headers
parentc79b0357ea74debbf9680fa1afa930c0600ef3c2 (diff)
downloadpack-bfc2b8d8396a08b7fbd1615ddabe721102323b76.tar.gz
pack-bfc2b8d8396a08b7fbd1615ddabe721102323b76.tar.xz
pack-bfc2b8d8396a08b7fbd1615ddabe721102323b76.zip
License header checking script
Diffstat (limited to 'scripts/license_headers')
-rwxr-xr-xscripts/license_headers14
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/license_headers b/scripts/license_headers
new file mode 100755
index 0000000..a381d02
--- /dev/null
+++ b/scripts/license_headers
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+mapfile -t ignore <.licignore
+
+ret=0
+
+while read -r -d ''; do
+ if ! grep -q SPDX-License-Identifier "$REPLY"; then
+ ret=1
+ echo "'$REPLY' has no SPDX-License-Identifier"
+ fi
+done < <(git ls-files -z "${ignore[@]/#/:!:}")
+
+exit "$ret"