Skip to content

Commit 29ad096

Browse files
authored
chore: update golangci-lint to latest v1 version and simplify config (#294)
* ci: upgrade to latest v1 version of `golangci-lint` * chore: update linter config * chore: sort disabled linters * chore: enable all linters by default * chore: disable unwanted linters * chore: add back `prettier-ignore`
1 parent a28da26 commit 29ad096

File tree

4 files changed

+20
-21
lines changed

4 files changed

+20
-21
lines changed

.github/workflows/checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
- name: Run golangci-lint
4747
uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 # v6.5.2
4848
with:
49-
version: v1.60
49+
version: v1.64
5050
go-fmt:
5151
permissions:
5252
contents: read # to fetch code (actions/checkout)

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- name: Run golangci-lint
4646
uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 # v6.5.2
4747
with:
48-
version: v1.60
48+
version: v1.64
4949
go-fmt:
5050
permissions:
5151
contents: read # to fetch code (actions/checkout)

.golangci.yaml

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,32 @@
11
output:
22
sort-results: true
33
linters:
4-
enable:
5-
- gofmt
6-
- goimports
4+
enable-all: true
75
# prettier-ignore
86
disable:
9-
- tagliatelle # we're parsing data from external sources
10-
- varnamelen # maybe later
7+
- cyclop
118
- exhaustruct # overkill
129
- forcetypeassert # too hard
13-
- lll # line length is hard
14-
- godox # to-do comments are fine
10+
- funlen
11+
- gocognit
12+
- gocyclo
1513
- godot # comments are fine without full stops
16-
- mnd # not every number is magic
17-
- wsl # disagree with, for now
14+
- godox # to-do comments are fine
15+
- maintidx
16+
- gofumpt
1817
- ireturn # disagree with, sort of
18+
- lll # line length is hard
19+
- mnd # not every number is magic
20+
- nestif
1921
- nonamedreturns # they have their uses
22+
- tagliatelle # we're parsing data from external sources
23+
- tenv # Deprecated
24+
- varnamelen # maybe later
25+
- wsl # disagree with, for now
2026
- intrange
2127
- copyloopvar
2228
- predeclared
2329
- govet
24-
presets:
25-
- bugs
26-
- comment
27-
- error
28-
- performance
29-
- sql
30-
- style
31-
- test
32-
- unused
3330

3431
linters-settings:
3532
depguard:
@@ -44,6 +41,8 @@ linters-settings:
4441
'Use github.com/g-rath/osv-detector/internal/cachedregexp instead'
4542

4643
issues:
44+
max-issues-per-linter: 0
45+
max-same-issues: 0
4746
exclude-rules:
4847
- path: _test\.go
4948
linters:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ test-with-coverage:
2121
lint: lint-with-golangci-lint lint-with-go-fmt
2222

2323
lint-with-golangci-lint:
24-
go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.0 run ./... --max-same-issues 0
24+
go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.8 run ./...
2525

2626
lint-with-go-fmt:
2727
gofmt -s -d */**.go

0 commit comments

Comments
 (0)