From bae219d46115c05f8a2060abe117d963697461d7 Mon Sep 17 00:00:00 2001 From: Johan Brandhorst-Satzkorn Date: Fri, 11 Aug 2023 15:02:29 -0700 Subject: [PATCH] Re-enable copywrite with hack (#3569) * Ignore license change commit from blame This changed almost all the files in the repo * Re-enable copywrite with hack Adds a hack that removes existing copyright headers from files before rerunning copywrite with directory specific configuration. --- .git-blame-ignore-revs | 4 +++- Makefile | 7 ++++++- internal/proto/controller/api/.copywrite.hcl | 8 ++++++++ internal/proto/controller/custom_options/.copywrite.hcl | 8 ++++++++ internal/proto/plugin/.copywrite.hcl | 8 ++++++++ 5 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 internal/proto/controller/api/.copywrite.hcl create mode 100644 internal/proto/controller/custom_options/.copywrite.hcl create mode 100644 internal/proto/plugin/.copywrite.hcl diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 2bfc96e075..ea3893ae8e 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -5,4 +5,6 @@ f69fbf22552deac9ec81503d629fb70919acabdb # Added license headers 3c29308673a9fb64c68ca27e15b4c9017a2d597e # Upgraded buf which updated protobuf files -982c9c263c5d7f9822cdae4d8fe38cac8e1ff98f \ No newline at end of file +982c9c263c5d7f9822cdae4d8fe38cac8e1ff98f +# Updated license to BUSL +29da0bcb923236b59fad97c3a66708b4d7e15bfb diff --git a/Makefile b/Makefile index 745e90c231..07f2d6cdde 100644 --- a/Makefile +++ b/Makefile @@ -133,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 @@ -263,6 +263,11 @@ protolint: .PHONY: copywrite copywrite: copywrite headers + # In the protobuf API directories, remove the BUSL headers + # and rerun copywrite with the directory specific configuration. + cd internal/proto/controller/api && find . -type f -name '*.proto' -exec sed -i '1,3d' {} + && copywrite headers + cd internal/proto/controller/custom_options && find . -type f -name '*.proto' -exec sed -i '1,3d' {} + && copywrite headers + cd internal/proto/plugin && find . -type f -name '*.proto' -exec sed -i '1,3d' {} + && copywrite headers .PHONY: website # must have nodejs and npm installed diff --git a/internal/proto/controller/api/.copywrite.hcl b/internal/proto/controller/api/.copywrite.hcl new file mode 100644 index 0000000000..cf8decfa9b --- /dev/null +++ b/internal/proto/controller/api/.copywrite.hcl @@ -0,0 +1,8 @@ +schema_version = 1 + +project { + license = "MPL-2.0" + copyright_year = 2020 + + header_ignore = [] +} diff --git a/internal/proto/controller/custom_options/.copywrite.hcl b/internal/proto/controller/custom_options/.copywrite.hcl new file mode 100644 index 0000000000..cf8decfa9b --- /dev/null +++ b/internal/proto/controller/custom_options/.copywrite.hcl @@ -0,0 +1,8 @@ +schema_version = 1 + +project { + license = "MPL-2.0" + copyright_year = 2020 + + header_ignore = [] +} diff --git a/internal/proto/plugin/.copywrite.hcl b/internal/proto/plugin/.copywrite.hcl new file mode 100644 index 0000000000..cf8decfa9b --- /dev/null +++ b/internal/proto/plugin/.copywrite.hcl @@ -0,0 +1,8 @@ +schema_version = 1 + +project { + license = "MPL-2.0" + copyright_year = 2020 + + header_ignore = [] +}