Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

golangci: fix copyright header linting #351

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
Expand Down
Loading