Skip to content

Commit ca1e2a0

Browse files
authored
fix: addlicense logic error and add check only mode (#7)
- add check-only mode for addlicense - fix a bug in addlicense target
2 parents 9b25763 + 8020d11 commit ca1e2a0

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

common.mk

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,12 @@ scan: $(OSV_SCANNER) ## scan for vulnerabilities
7676

7777
.PHONY: addlicense
7878
addlicense: $(ADDLICENSE) ## Add License headers containing of `license` and `comment` to files matched by `pattern`.
79-
@test -n "$(license)" && test -n "$(comment)" && test -n "$(pattern)" \
80-
git ls-files '$(pattern)' | xargs -r $(ADDLICENSE) -c '$(comment)' -l '$(license)' -s=only
79+
@test -n "$(license)" && test -n "$(comment)" && test -n "$(pattern)" && \
80+
git ls-files '$(pattern)' | xargs -r $(ADDLICENSE) -c '$(comment)' -l '$(license)' -s=only $(extraargs)
81+
82+
.PHONY: addlicense-check
83+
addlicense-check:
84+
$(MAKE) addlicense extraargs='-check'
8185

8286
# Local dev environment
8387
.PHONY: setup-local-cluster

0 commit comments

Comments
 (0)