Skip to content

Commit

Permalink
added make target to add copyright headers
Browse files Browse the repository at this point in the history
  • Loading branch information
wilkermichael committed Feb 12, 2024
1 parent 64e2d56 commit 16e4b94
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .copywrite.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
schema_version = 1

project {
license = "MPL-2.0"
copyright_year = 2018

# (OPTIONAL) A list of globs that should not have copyright/license headers.
# Supports doublestar glob patterns for more flexibility in defining which
# files or folders should be ignored
header_ignore = [

# ignoring charts templates as adding copyright headers breaks all tests
"charts/consul/templates/**",
# we don't own these and the tool that adds copyright headers breaks them
"control-plane/config/crd/external/**",

]
}
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ lint: cni-plugin-lint ## Run linter in the control-plane, cli, and acceptance di
ctrl-manifests: get-controller-gen ## Generate CRD manifests.
cd control-plane; $(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
make copy-crds-to-chart
make add-copyright-header

.PHONY: get-controller-gen
get-controller-gen: ## Download controller-gen program needed for operator SDK.
Expand All @@ -192,6 +193,14 @@ else
CONTROLLER_GEN=$(shell which controller-gen)
endif

.PHONY: add-copyright-header
add-copyright-header: ## Add copyright header to all files in the project
ifeq (, $(shell which copywrite))
@echo "Installing copywrite"
@go install github.com/hashicorp/copywrite@latest
endif
@copywrite headers --spdx "MPL-2.0"

##@ CI Targets

.PHONY: ci.aws-acceptance-test-cleanup
Expand Down

0 comments on commit 16e4b94

Please sign in to comment.