[v3] devtools: add new SPDX license compliance checker
diff mbox series

Message ID 20200207175217.14974-1-stephen@networkplumber.org
State New
Delegated to: Thomas Monjalon
Headers show
Series
  • [v3] devtools: add new SPDX license compliance checker
Related show

Checks

Context Check Description
ci/travis-robot success Travis build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger Feb. 7, 2020, 5:52 p.m. UTC
Simple script to look for drivers and scripts that
are missing requires SPDX header.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
v3 - pickup more places with boilerplate text
     avoid false positive for cocci scripts or abignore

 devtools/spdx-check.sh | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100755 devtools/spdx-check.sh

Patch
diff mbox series

diff --git a/devtools/spdx-check.sh b/devtools/spdx-check.sh
new file mode 100755
index 000000000000..a5be10b26f44
--- /dev/null
+++ b/devtools/spdx-check.sh
@@ -0,0 +1,24 @@ 
+#! /bin/sh
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2019 Microsoft Corporation
+#
+# Produce a list of files with incorrect license
+# information
+
+echo "Files without SPDX License"
+echo "--------------------------"
+
+git grep -L SPDX-License-Identifier -- \
+    ':^.git*' ':^.ci/*' ':^.travis.yml' \
+    ':^README' ':^MAINTAINERS' ':^VERSION' ':^ABI_VERSION' \
+    ':^*/Kbuild' ':^*/README' \
+    ':^license/' ':^doc/' ':^config/' ':^buildtools/' \
+    ':^*.cocci' ':^*.abignore' \
+    ':^*.def' ':^*.map' ':^*.ini' ':^*.data' ':^*.cfg' ':^*.txt'
+
+echo
+echo "Files with additional license text"
+echo "----------------------------------"
+
+git grep -l Redistribution -- \
+    ':^license/' ':^/devtools/spdx-check.sh'