aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.licignore2
-rwxr-xr-xscripts/license_headers14
2 files changed, 16 insertions, 0 deletions
diff --git a/.licignore b/.licignore
new file mode 100644
index 0000000..b15fcab
--- /dev/null
+++ b/.licignore
@@ -0,0 +1,2 @@
+.gitignore
+.licignore
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"