From 02a1f7b77072eea5deac394eaacabbae63c867b6 Mon Sep 17 00:00:00 2001 From: Joshua Sing Date: Fri, 3 Jan 2025 02:22:36 +1100 Subject: [PATCH] golangci: fix copyright header linting --- .golangci.yaml | 6 ++++-- Makefile | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index 135f17ef..032bf6f0 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -85,12 +85,14 @@ linters-settings: - "github.com/coder/websocket" # Currently uses our fork with a bug fix. # Enforces copyright header - goheader: + goheader: # TODO: Replace goheader, autofix is too buggy. values: const: COMPANY: "Hemi Labs, Inc." + regexp: + YEAR_RANGE: "(\\d{4}-{{MOD-YEAR}})|({{MOD-YEAR}})" template: |- - Copyright (c) {{ YEAR }} {{ COMPANY }} + Copyright (c) {{ YEAR_RANGE }} {{ COMPANY }} Use of this source code is governed by the MIT License, which can be found in the LICENSE file. diff --git a/Makefile b/Makefile index 188b798a..f2d59c67 100644 --- a/Makefile +++ b/Makefile @@ -53,7 +53,8 @@ build: install: $(cmds) lint: - $(shell go env GOPATH)/bin/golangci-lint run --fix ./... + # TODO: re-enable autofix with --fix, after removing buggy goheader linter + $(shell go env GOPATH)/bin/golangci-lint run ./... lint-deps: GOBIN=$(shell go env GOPATH)/bin go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62