summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2017-10-25 11:33:19 -0500
committerChristopher Speller <crspeller@gmail.com>2017-10-25 09:33:19 -0700
commit5dd4466ab32d55f1369ad6a30670b3559ff41e11 (patch)
treeb26dd5e89550023ed8d8638fd54dc87276f2a75b /scripts
parent62b3569025347a1291229771f363be5962951f25 (diff)
downloadchat-5dd4466ab32d55f1369ad6a30670b3559ff41e11.tar.gz
chat-5dd4466ab32d55f1369ad6a30670b3559ff41e11.tar.bz2
chat-5dd4466ab32d55f1369ad6a30670b3559ff41e11.zip
add missing license headers, test to makefile (#7711)
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/license-check.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/license-check.sh b/scripts/license-check.sh
new file mode 100755
index 000000000..be3b62508
--- /dev/null
+++ b/scripts/license-check.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+set -e
+IFS=$'\n'
+count=0
+for fileType in GoFiles; do
+ for file in `go list -f $'{{range .GoFiles}}{{$.Dir}}/{{.}}\n{{end}}' "$@"`; do
+ case $file in
+ */utils/lru.go)
+ # Third-party, doesn't require a header.
+ ;;
+ *)
+ if ! grep 'Mattermost, Inc. All Rights Reserved.' $file -q; then
+ >&2 echo "FAIL: $file is missing a license header."
+ ((count++))
+ fi
+ esac
+ done
+done
+if [ $count -eq 0 ]; then
+ exit 0
+fi
+
+if [ $count -gt 1 ]; then
+ >&2 echo "$count files are missing license headers."
+else
+ >&2 echo "$count file is missing a license header."
+fi
+exit 1