Skip to content

Commit ff29eec

Browse files
committed
feat: add general addlicense target
1 parent 049f55d commit ff29eec

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

common.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ OSV_SCANNER_CONFIG ?= ./.osv-scanner.toml
7474
scan: $(OSV_SCANNER) ## scan for vulnerabilities
7575
$(OSV_SCANNER) scan --config $(OSV_SCANNER_CONFIG) -r .
7676

77+
.PHONY: addlicense
78+
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
81+
7782
# Local dev environment
7883
.PHONY: setup-local-cluster
7984
setup-local-cluster: ## Set up a Kind cluster for local development if it does not exist

0 commit comments

Comments
 (0)