diff --git a/.copywrite.hcl b/.copywrite.hcl new file mode 100644 index 0000000000..f12ea14ccc --- /dev/null +++ b/.copywrite.hcl @@ -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/**", + + ] +} \ No newline at end of file diff --git a/Makefile b/Makefile index 92c4f42b56..8177219103 100644 --- a/Makefile +++ b/Makefile @@ -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. @@ -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