Skip to content

Commit 6388c2a

Browse files
committed
ci: add golangci-lint
Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 5de6d3a commit 6388c2a

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

Diff for: .github/workflows/test.yml

+6
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ jobs:
2828
with:
2929
go-version: ${{ matrix.go-version }}
3030

31+
- name: lint
32+
uses: golangci/golangci-lint-action@v7
33+
with:
34+
version: v2.0
35+
args: --print-resources-usage --timeout=10m --verbose
36+
3137
- name: Test
3238
run: go test -v -cover "-coverprofile=coverage.txt" -covermode=atomic ./...
3339
shell: bash

Diff for: .golangci.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
version: "2"
2+
3+
linters:
4+
enable:
5+
- errorlint
6+
- unconvert
7+
- unparam
8+
exclusions:
9+
generated: disable
10+
presets:
11+
- comments
12+
- std-error-handling
13+
settings:
14+
staticcheck:
15+
# Enable all options, with some exceptions.
16+
# For defaults, see https://golangci-lint.run/usage/linters/#staticcheck
17+
checks:
18+
- all
19+
- -QF1008 # Omit embedded fields from selector expression; https://staticcheck.dev/docs/checks/#QF1008
20+
- -ST1003 # Poorly chosen identifier; https://staticcheck.dev/docs/checks/#ST1003
21+
22+
formatters:
23+
enable:
24+
- gofmt
25+
- goimports
26+
# - gofumpt # FIXME: skipping "gofumpt" as it shows some false positives on Windows; see https://github.com/moby/go-archive/pull/4#issuecomment-2802113443
27+
exclusions:
28+
generated: disable

0 commit comments

Comments
 (0)