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:
parent
ecbd5f08c3
commit
fe60ba02a3
11
Makefile
11
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
|
||||
gometalinter.v2 --install
|
||||
|
10
scripts/check-for-header.sh
Executable file
10
scripts/check-for-header.sh
Executable 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
|
Loading…
Reference in New Issue
Block a user