Skip to content

Commit 00ebf58

Browse files
committed
chore: update linter
1 parent 38dd4b1 commit 00ebf58

File tree

3 files changed

+96
-100
lines changed

3 files changed

+96
-100
lines changed

.github/workflows/go-cross.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ name: Go Matrix
33
on:
44
push:
55
branches:
6-
- master
76
- main
87
pull_request:
98
branches:
10-
- master
119
- main
1210

1311
jobs:

.github/workflows/main.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ name: Main
33
on:
44
push:
55
branches:
6-
- master
76
- main
87
pull_request:
98
branches:
10-
- master
119
- main
1210

1311
jobs:
@@ -17,7 +15,7 @@ jobs:
1715
runs-on: ubuntu-latest
1816
env:
1917
GO_VERSION: stable
20-
GOLANGCI_LINT_VERSION: v1.64.6
18+
GOLANGCI_LINT_VERSION: v2.0.1
2119
CGO_ENABLED: 0
2220

2321
steps:
@@ -36,7 +34,7 @@ jobs:
3634
# https://golangci-lint.run/usage/install#other-ci
3735
- name: Install golangci-lint ${{ env.GOLANGCI_LINT_VERSION }}
3836
run: |
39-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_LINT_VERSION}
37+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_LINT_VERSION}
4038
golangci-lint --version
4139
4240
- name: Make

.golangci.yml

Lines changed: 94 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,108 @@
1+
version: "2"
2+
3+
formatters:
4+
enable:
5+
- gci
6+
- gofumpt
7+
settings:
8+
gofumpt:
9+
extra-rules: true
10+
111
linters:
2-
enable-all: true
12+
default: all
313
disable:
4-
- tenv # deprecated
5-
- sqlclosecheck # not relevant (SQL)
6-
- rowserrcheck # not relevant (SQL)
714
- cyclop # duplicate of gocyclo
8-
- lll
915
- dupl
10-
- prealloc
11-
- wsl
12-
- nlreturn
13-
- mnd
14-
- testpackage
15-
- paralleltest
16-
- tparallel
1716
- err113
18-
- wrapcheck
1917
- exhaustive
2018
- exhaustruct
21-
- varnamelen
19+
- lll
20+
- mnd
2221
- nilnil
22+
- nlreturn
23+
- paralleltest
24+
- prealloc
25+
- rowserrcheck # not relevant (SQL)
26+
- sqlclosecheck # not relevant (SQL)
27+
- testpackage
28+
- tparallel
29+
- varnamelen
30+
- wrapcheck
31+
- wsl
32+
settings:
33+
depguard:
34+
rules:
35+
main:
36+
deny:
37+
- pkg: github.com/instana/testify
38+
desc: not allowed
39+
- pkg: github.com/pkg/errors
40+
desc: Should be replaced by standard lib errors package
41+
forbidigo:
42+
forbid:
43+
- pattern: ^print(ln)?$
44+
- pattern: ^spew\.Print(f|ln)?$
45+
- pattern: ^spew\.Dump$
46+
funlen:
47+
lines: -1
48+
statements: 40
49+
goconst:
50+
min-len: 3
51+
min-occurrences: 3
52+
gocritic:
53+
disabled-checks:
54+
- sloppyReassign
55+
- rangeValCopy
56+
- octalLiteral
57+
- paramTypeCombine # already handle by gofumpt.extra-rules
58+
enabled-tags:
59+
- diagnostic
60+
- style
61+
- performance
62+
settings:
63+
hugeParam:
64+
sizeThreshold: 100
65+
gocyclo:
66+
min-complexity: 12
67+
godox:
68+
keywords:
69+
- FIXME
70+
gomoddirectives:
71+
replace-allow-list:
72+
- github.com/abbot/go-http-auth
73+
- github.com/go-check/check
74+
- github.com/gorilla/mux
75+
- github.com/mailgun/minheap
76+
- github.com/mailgun/multibuf
77+
- github.com/jaguilar/vt100
78+
gosec:
79+
excludes:
80+
- G204 # Subprocess launched with a potential tainted input or cmd arguments
81+
- G301 # Expect directory permissions to be 0750 or less
82+
- G306 # Expect WriteFile permissions to be 0600 or less
83+
govet:
84+
disable:
85+
- fieldalignment
86+
enable-all: true
87+
misspell:
88+
locale: US
2389

24-
linters-settings:
25-
govet:
26-
enable-all: true
27-
disable:
28-
- fieldalignment
29-
gocyclo:
30-
min-complexity: 12
31-
goconst:
32-
min-len: 3
33-
min-occurrences: 3
34-
misspell:
35-
locale: US
36-
gofumpt:
37-
extra-rules: true
38-
depguard:
90+
exclusions:
91+
presets:
92+
- comments
3993
rules:
40-
main:
41-
deny:
42-
- pkg: "github.com/instana/testify"
43-
desc: not allowed
44-
- pkg: "github.com/pkg/errors"
45-
desc: Should be replaced by standard lib errors package
46-
funlen:
47-
lines: -1
48-
statements: 40
49-
godox:
50-
keywords:
51-
- FIXME
52-
gocritic:
53-
enabled-tags:
54-
- diagnostic
55-
- style
56-
- performance
57-
disabled-checks:
58-
- sloppyReassign
59-
- rangeValCopy
60-
- octalLiteral
61-
- paramTypeCombine # already handle by gofumpt.extra-rules
62-
settings:
63-
hugeParam:
64-
sizeThreshold: 100
65-
forbidigo:
66-
forbid:
67-
- '^print(ln)?$'
68-
- '^spew\.Print(f|ln)?$'
69-
- '^spew\.Dump$'
70-
gomoddirectives:
71-
replace-allow-list:
72-
- github.com/abbot/go-http-auth
73-
- github.com/go-check/check
74-
- github.com/gorilla/mux
75-
- github.com/mailgun/minheap
76-
- github.com/mailgun/multibuf
77-
- github.com/jaguilar/vt100
78-
gosec:
79-
excludes:
80-
- G204 # Subprocess launched with a potential tainted input or cmd arguments
81-
- G301 # Expect directory permissions to be 0750 or less
82-
- G306 # Expect WriteFile permissions to be 0600 or less
94+
- linters:
95+
- gochecknoglobals
96+
- gochecknoinits
97+
path: cmd/
98+
- linters:
99+
- tagalign
100+
path: internal/traefikv[1-3]/
101+
- path: (.+)\.go$
102+
text: 'ST1000: at least one file in a package should have a package comment'
103+
- path: (.+)\.go$
104+
text: 'package-comments: should have a package comment'
83105

84106
issues:
85-
exclude-use-default: false
86107
max-issues-per-linter: 0
87108
max-same-issues: 0
88-
exclude:
89-
- 'ST1000: at least one file in a package should have a package comment'
90-
- 'package-comments: should have a package comment'
91-
exclude-rules:
92-
- path: cmd/
93-
linters:
94-
- gochecknoglobals
95-
- gochecknoinits
96-
- path: internal/traefikv[1-3]/
97-
linters:
98-
- tagalign
99-
100-
output:
101-
show-stats: true
102-
sort-results: true
103-
sort-order:
104-
- linter
105-
- file
106-
107-
run:
108-
timeout: 5m

0 commit comments

Comments
 (0)