lint step for copyright headers (#16)

* overlay proto

* grpc server and client

* fix import to storj

* tests

* change imports

* imports cleanup/comments

* PR comments addressed from @jtolds

* lint step for copyright headers

* spelling

* PR comments addressed from @jtolds
This commit is contained in:
Dennis Coyle 2018-04-23 12:05:52 -04:00 committed by JT Olds
parent ecbd5f08c3
commit fe60ba02a3
2 changed files with 18 additions and 3 deletions

View File

@ -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
gometalinter.v2 --install

10
scripts/check-for-header.sh Executable file
View File

@ -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