From eb7840b4c4fd9678031fef9fd61a68902559d6f0 Mon Sep 17 00:00:00 2001 From: Ignasi Barrera Date: Thu, 10 Oct 2024 12:03:48 +0200 Subject: [PATCH] Use a better maintained and more flexible license checker tool (#267) Signed-off-by: Ignasi Barrera --- .licenserc.yaml | 35 +++++++++++++++++++++++++++ .licenserignore | 16 ------------ Makefile | 2 +- e2e/istio/cluster/istiogw-config.yaml | 2 +- env.mk | 2 +- 5 files changed, 38 insertions(+), 19 deletions(-) create mode 100644 .licenserc.yaml delete mode 100644 .licenserignore diff --git a/.licenserc.yaml b/.licenserc.yaml new file mode 100644 index 00000000..33ba6033 --- /dev/null +++ b/.licenserc.yaml @@ -0,0 +1,35 @@ +# Copyright 2024 Tetrate +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +header: + license: + spdx-id: Apache-2.0 + copyright-owner: Tetrate + paths-ignore: + - '**/go.mod' + - '**/go.sum' + - '**/*.md' + - '**/*.lock' + - '**/*.txt' + - '**/*.json' + - '**/*.crt' + - '**/*.csr' + - '**/*.srl' + - '**/*.key' + - '**/.gitignore' + - '**/kubeconfig' + - '**/bin/*' + - LICENSE + - CODEOWNERS + - 'config/**/*.go' diff --git a/.licenserignore b/.licenserignore deleted file mode 100644 index c54f896f..00000000 --- a/.licenserignore +++ /dev/null @@ -1,16 +0,0 @@ -*.txt -.idea -go.mod -go.sum -*.png -*.lock -config/**/*.go -bin/ -.vimrc -*.json -LICENSE -*.crt -*.csr -*.srl -*.key -kubeconfig diff --git a/Makefile b/Makefile index 4d8f2195..e89ed8c1 100644 --- a/Makefile +++ b/Makefile @@ -203,7 +203,7 @@ lint: $(GOLANGCI_LINT_CONFIG) config/lint ## Lint checks for all Go code .PHONY: format format: go.mod ## Format all Go code @echo "Formatting code" - @go run $(LICENSER) apply -r "Tetrate" + @@go run $(SWEYES) header fix @go run $(GOSIMPORTS) -local $(GO_MODULE) -w . @gofmt -w . diff --git a/e2e/istio/cluster/istiogw-config.yaml b/e2e/istio/cluster/istiogw-config.yaml index 3a40c90a..05d3ebb1 100644 --- a/e2e/istio/cluster/istiogw-config.yaml +++ b/e2e/istio/cluster/istiogw-config.yaml @@ -1,4 +1,4 @@ -# Copyright 2023 Tetrate +# Copyright 2024 Tetrate # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/env.mk b/env.mk index f602f60c..b000dcad 100644 --- a/env.mk +++ b/env.mk @@ -20,7 +20,7 @@ NAME ?= authservice GOLANGCI_LINT ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0 GOSIMPORTS ?= github.com/rinchsan/gosimports/cmd/gosimports@v0.3.8 -LICENSER ?= github.com/liamawhite/licenser@v0.6.1-0.20210729145742-be6c77bf6a1f +SWEYES ?= github.com/apache/skywalking-eyes/cmd/license-eye@v0.6.0 KIND ?= sigs.k8s.io/kind@v0.18.0 ENVTEST ?= sigs.k8s.io/controller-runtime/tools/setup-envtest@latest