diff --git a/Makefile b/Makefile index a757552f1..14f68ad2e 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -lint: - @echo "gometalinter" +lint: check-copyrights + @echo "Running ${@}" @gometalinter.v2 \ --deadline=60s \ --disable-all \ @@ -11,12 +11,17 @@ lint: --exclude=.*\.pb\.go \ ./... +check-copyrights: + @echo "Running ${@}" + @./scripts/check-for-header.sh + proto: @echo "Running ${@}" ./scripts/build-protos.sh + build-dev-deps: go get -u github.com/golang/protobuf/protoc-gen-go go get -u gopkg.in/alecthomas/gometalinter.v2 - gometalinter.v2 --install \ No newline at end of file + gometalinter.v2 --install diff --git a/scripts/check-for-header.sh b/scripts/check-for-header.sh new file mode 100755 index 000000000..ffc306228 --- /dev/null +++ b/scripts/check-for-header.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +FILES=$(find $PWD -type f \( -iname '*.go' ! -iname "*.pb.go" \) ) +for i in $FILES +do + if ! grep -q 'Copyright' <<< "$(head -n 2 "$i")" + then + echo " missing copyright header for $i" + fi +done