From 111b53c3b71a866f825b877159a720e7797f0724 Mon Sep 17 00:00:00 2001 From: Chun-Hung Tseng Date: Fri, 13 Sep 2024 13:12:33 +0200 Subject: [PATCH] Add license header lint rules --- tools/.golangci.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tools/.golangci.yaml b/tools/.golangci.yaml index d45230ae..cb8d0b0a 100644 --- a/tools/.golangci.yaml +++ b/tools/.golangci.yaml @@ -82,3 +82,22 @@ linters-settings: - name: error-strings severity: error disabled: false + # https://golangci-lint.run/usage/linters/#goheader + goheader: + values: + regexp: + AUTHOR: ^Copyright 2024 (The Kubernetes authors|Swisscom \(Schweiz\) AG)\. + template: |- + {{ AUTHOR }} + + 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.