From dcb499ed4f43f93b6df8905e036c6fe929946bc0 Mon Sep 17 00:00:00 2001 From: Johan Brandhorst-Satzkorn Date: Thu, 2 Feb 2023 17:15:05 -0800 Subject: [PATCH] chore: Add copywrite Makefile target The new copywrite target can be used to add any missing license headers. --- .copywrite.hcl | 17 +++++++++++++++++ Makefile | 7 ++++++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 .copywrite.hcl diff --git a/.copywrite.hcl b/.copywrite.hcl new file mode 100644 index 0000000000..8e16f332a0 --- /dev/null +++ b/.copywrite.hcl @@ -0,0 +1,17 @@ +schema_version = 1 + +project { + license = "MPL-2.0" + copyright_year = 2023 + + header_ignore = [ + ".circleci/**", + ".github/**", + ".golangci.yml", + ".release/linux/**", + "enos/.enos/**", + "internal/ui/.tmp/**", + "website/.eslintrc.js", + "website/prettier.config.js", + ] +} diff --git a/Makefile b/Makefile index 7f155bc179..1501cb656b 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,7 @@ tools: golangci-lint go generate -tags tools tools/tools.go go install github.com/bufbuild/buf/cmd/buf@v1.3.1 go install github.com/mfridman/tparse@v0.10.3 + go install github.com/hashicorp/copywrite@v0.15.0 # golangci-lint recommends installing the binary directly, instead of using go get # See the note: https://golangci-lint.run/usage/install/#install-from-source @@ -132,7 +133,7 @@ perms-table: @go run internal/website/permstable/permstable.go .PHONY: gen -gen: cleangen proto api cli perms-table fmt +gen: cleangen proto api cli perms-table fmt copywrite ### oplog requires protoc-gen-go v1.20.0 or later # GO111MODULE=on go get -u github.com/golang/protobuf/protoc-gen-go@v1.40 @@ -250,6 +251,10 @@ protolint: cd internal/proto && buf breaking --against 'https://github.com/hashicorp/boundary.git#branch=stable-website,subdir=internal/proto' \ --config buf.breaking.wire.yaml +.PHONY: copywrite +copywrite: + copywrite headers + .PHONY: website # must have nodejs and npm installed website: website-install website-start