chore(check): Add license-check for .go , .sh , Dockerfile and Makefile (#205)

Signed-off-by: ajeetrai707 <ajeetrai707@gmail.com>
This commit is contained in:
ajeet_rai 2020-09-08 20:37:59 +05:30 committed by GitHub
parent e40026c98a
commit 27fe7e3b06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 115 additions and 2 deletions

View file

@ -93,7 +93,7 @@ export DBUILD_ARGS=--build-arg DBUILD_DATE=${DBUILD_DATE} --build-arg DBUILD_REP
CSI_DRIVER=zfs-driver
.PHONY: all
all: test manifests zfs-driver-image
all: license-check test manifests zfs-driver-image
.PHONY: clean
clean:
@ -246,3 +246,16 @@ golint:
@echo "Completed golint no recommendations !!"
@echo "--------------------------------"
@echo ""
.PHONY: license-check
license-check:
@echo "--> Checking license header..."
@licRes=$$(for file in $$(find . -type f -regex '.*\.sh\|.*\.go\|.*Docker.*\|.*\Makefile*' ! -path './vendor/*' ) ; do \
awk 'NR<=5' $$file | grep -Eq "(Copyright|generated|GENERATED)" || echo $$file; \
done); \
if [ -n "$${licRes}" ]; then \
echo "license header checking failed:"; echo "$${licRes}"; \
exit 1; \
fi
@echo "--> Done checking license."
@echo