Skip to content

Commit 2fd3d09

Browse files
committed
ci: add golangci-lint
Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 3b914fa commit 2fd3d09

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-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.1
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

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
version: "2"
2+
3+
issues:
4+
# Disable maximum issues count per one linter.
5+
max-issues-per-linter: 0
6+
# Disable maximum count of issues with the same text.
7+
max-same-issues: 0
8+
9+
linters:
10+
enable:
11+
- errorlint
12+
- unconvert
13+
- unparam
14+
exclusions:
15+
generated: disable
16+
presets:
17+
- comments
18+
- std-error-handling
19+
settings:
20+
staticcheck:
21+
# Enable all options, with some exceptions.
22+
# For defaults, see https://golangci-lint.run/usage/linters/#staticcheck
23+
checks:
24+
- all
25+
- -QF1008 # Omit embedded fields from selector expression; https://staticcheck.dev/docs/checks/#QF1008
26+
- -ST1003 # Poorly chosen identifier; https://staticcheck.dev/docs/checks/#ST1003
27+
28+
formatters:
29+
enable:
30+
- gofumpt
31+
- goimports
32+
exclusions:
33+
generated: disable

0 commit comments

Comments
 (0)