From 11c4c5f42daec5a7345e3a1898f5aad0e41731fe Mon Sep 17 00:00:00 2001 From: Chun-Hung Tseng Date: Mon, 11 Nov 2024 13:39:14 +0100 Subject: [PATCH] Add license header lint rules (#60) --- tools/.golangci.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tools/.golangci.yaml b/tools/.golangci.yaml index d45230a..cb8d0b0 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.