Skip to content

Commit

Permalink
golangci: fix copyright header linting (#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuasing authored Jan 3, 2025
1 parent da13fb3 commit 71a3e1f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
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

0 comments on commit 71a3e1f

Please sign in to comment.