add missing license headers, test to makefile (#7711)

Этот коммит содержится в:
Chris
2017-10-25 11:33:19 -05:00
коммит произвёл Christopher Speller
родитель 62b3569025
Коммит 5dd4466ab3
30 изменённых файлов: 114 добавлений и 1 удалений

28
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