Merge "Added copyright in Makefile"

This commit is contained in:
Zuul 2020-07-21 22:00:09 +00:00 committed by Gerrit Code Review
commit 3fefc40632
3 changed files with 15 additions and 2 deletions

View File

@ -82,6 +82,7 @@ install-npm-modules: $(NPX)
cd $(WEBDIR) && (PATH="$(PATH):$(JSLINTER_BIN)"; $(NPM) install) && cd ..
.PHONY: test
test: check-copyright
test:
go test $(RECURSIVE_DIRS) -v $(TESTFLAGS)
@ -170,3 +171,13 @@ $(LINTER):
$(NPX):
@mkdir -p $(TOOLBINDIR)
./tools/install_js_linter
# add-copyright is a utility to add copyright header to missing files
.PHONY: add-copyright
add-copyright:
@./tools/add_license.sh
# check-copyright is a utility to check if copyright header is present on all files
.PHONY: check-copyright
check-copyright:
@./tools/check_copyright

View File

@ -19,7 +19,8 @@ add_license() {
ext=$1
template=$2
# skipping license for testdata and manifests folders
FILES=$(find -L . -name "*.${ext}" | grep -v "testdata" | grep -v "manifests")
# also skipping license for node and node_modules
FILES=$(find -L . -name "*.${ext}" | grep -v "testdata" | grep -v "manifests" | grep -v "tools/*node*" | grep -v "web/node_modules")
for each in $FILES
do

View File

@ -18,7 +18,8 @@ declare FILES_MISSING_COPYRIGHT=()
check_license() {
ext=$1
# skipping license for testdata and manifests folders
FILES=$(find -L . -name "*.${ext}" | grep -v "testdata" | grep -v "manifests")
# also skipping licence for node and node_modules
FILES=$(find -L . -name "*.${ext}" | grep -v "testdata" | grep -v "manifests" | grep -v "tools/*node*" | grep -v "web/node_modules")
for each in $FILES
do