[RFC] devtools: add spdx license check tool

Message ID 20190814164320.12376-1-stephen@networkplumber.org (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series [RFC] devtools: add spdx license check tool |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Stephen Hemminger Aug. 14, 2019, 4:43 p.m. UTC
  This is a simple script to print files that have missing SPDX
license tag and list of files with redundant boilerplate.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 devtools/spdx-check.sh | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100755 devtools/spdx-check.sh
  

Patch

diff --git a/devtools/spdx-check.sh b/devtools/spdx-check.sh
new file mode 100755
index 000000000000..c77454a8b320
--- /dev/null
+++ b/devtools/spdx-check.sh
@@ -0,0 +1,19 @@ 
+#! /bin/sh
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2019 Microsoft Corporation
+#
+# Produce a list of files without SPDX license identifiers
+
+echo "Files without SPDX License"
+echo "--------------------------"
+
+git grep -L SPDX-License-Identifier | \
+    grep -v '^\.' |grep -v '^license/' |\
+    grep -v '\.map$' | grep -v '\.png$' | grep -v '\.svg$'
+
+echo
+echo "Files with redundant BSD boilerplate"
+echo "------------------------------------"
+
+git grep -l SPDX-License-Identifier | \
+    xargs grep -l 'Redistribution and use'