Skip to content

Commit 814a32c

Browse files
committed
chore: update linter
1 parent 2fbac59 commit 814a32c

File tree

5 files changed

+120
-112
lines changed

5 files changed

+120
-112
lines changed

.github/workflows/go-cross.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
branches:
66
- main
77
pull_request:
8+
branches:
9+
- main
810

911
jobs:
1012

.github/workflows/main.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
branches:
66
- main
77
pull_request:
8+
branches:
9+
- main
810

911
jobs:
1012

@@ -13,8 +15,7 @@ jobs:
1315
runs-on: ubuntu-latest
1416
env:
1517
GO_VERSION: stable
16-
GOLANGCI_LINT_VERSION: v1.63.4
17-
SEIHON_VERSION: v0.9.0
18+
GOLANGCI_LINT_VERSION: v2.0.1
1819
CGO_ENABLED: 0
1920

2021
steps:

.github/workflows/release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ jobs:
1010
runs-on: ubuntu-latest
1111
env:
1212
GO_VERSION: stable
13-
SEIHON_VERSION: v0.9.0
1413
CGO_ENABLED: 0
1514

1615
steps:

.golangci.yml

Lines changed: 114 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -1,122 +1,128 @@
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-
- exportloopref # deprecated
514
- cyclop # duplicate of gocyclo
6-
- sqlclosecheck # not relevant (SQL)
7-
- rowserrcheck # not relevant (SQL)
8-
- lll
9-
- gosec
1015
- dupl
11-
- prealloc
12-
- wsl
13-
- nlreturn
14-
- mnd
15-
- testpackage
16-
- paralleltest
17-
- tparallel
1816
- err113
19-
- wrapcheck
2017
- exhaustive
2118
- exhaustruct
22-
- varnamelen
23-
- nilnil
24-
- gosmopolitan # not relevant
19+
- gosec
20+
- gosmopolitan # not relevant
21+
- lll
22+
- mnd
2523
- musttag
24+
- nilnil
25+
- nlreturn
26+
- paralleltest
27+
- prealloc
28+
- rowserrcheck # not relevant (SQL)
29+
- sqlclosecheck # not relevant (SQL)
30+
- testpackage
31+
- tparallel
32+
- varnamelen
33+
- wrapcheck
34+
- wsl
2635

27-
linters-settings:
28-
govet:
29-
enable-all: true
30-
disable:
31-
- fieldalignment
32-
gocyclo:
33-
min-complexity: 13
34-
goconst:
35-
min-len: 3
36-
min-occurrences: 3
37-
misspell:
38-
locale: US
39-
gofumpt:
40-
extra-rules: true
41-
depguard:
42-
rules:
43-
main:
44-
deny:
45-
- pkg: "github.com/instana/testify"
46-
desc: not allowed
47-
- pkg: "github.com/pkg/errors"
48-
desc: Should be replaced by standard lib errors package
49-
funlen:
50-
lines: -1
51-
statements: 40
52-
godox:
53-
keywords:
54-
- FIXME
55-
gocritic:
56-
enabled-tags:
57-
- diagnostic
58-
- style
59-
- performance
60-
disabled-checks:
61-
- sloppyReassign
62-
- rangeValCopy
63-
- octalLiteral
64-
- paramTypeCombine # already handle by gofumpt.extra-rules
65-
settings:
66-
hugeParam:
67-
sizeThreshold: 100
68-
forbidigo:
69-
forbid:
70-
- '^print(ln)?$'
71-
- '^spew\.Print(f|ln)?$'
72-
- '^spew\.Dump$'
73-
gomoddirectives:
74-
replace-allow-list:
75-
- github.com/abbot/go-http-auth
76-
- github.com/go-check/check
77-
- github.com/gorilla/mux
78-
- github.com/mailgun/minheap
79-
- github.com/mailgun/multibuf
80-
- github.com/jaguilar/vt100
81-
revive:
36+
settings:
37+
depguard:
38+
rules:
39+
main:
40+
deny:
41+
- pkg: github.com/instana/testify
42+
desc: not allowed
43+
- pkg: github.com/pkg/errors
44+
desc: Should be replaced by standard lib errors package
45+
forbidigo:
46+
forbid:
47+
- pattern: ^print(ln)?$
48+
- pattern: ^spew\.Print(f|ln)?$
49+
- pattern: ^spew\.Dump$
50+
funlen:
51+
lines: -1
52+
statements: 40
53+
goconst:
54+
min-len: 3
55+
min-occurrences: 3
56+
gocritic:
57+
disabled-checks:
58+
- sloppyReassign
59+
- rangeValCopy
60+
- octalLiteral
61+
- paramTypeCombine # already handle by gofumpt.extra-rules
62+
enabled-tags:
63+
- diagnostic
64+
- style
65+
- performance
66+
settings:
67+
hugeParam:
68+
sizeThreshold: 100
69+
gocyclo:
70+
min-complexity: 13
71+
godox:
72+
keywords:
73+
- FIXME
74+
gomoddirectives:
75+
replace-allow-list:
76+
- github.com/abbot/go-http-auth
77+
- github.com/go-check/check
78+
- github.com/gorilla/mux
79+
- github.com/mailgun/minheap
80+
- github.com/mailgun/multibuf
81+
- github.com/jaguilar/vt100
82+
govet:
83+
disable:
84+
- fieldalignment
85+
enable-all: true
86+
misspell:
87+
locale: US
88+
revive:
89+
rules:
90+
- name: struct-tag
91+
- name: blank-imports
92+
- name: context-as-argument
93+
- name: context-keys-type
94+
- name: dot-imports
95+
- name: error-return
96+
- name: error-strings
97+
- name: error-naming
98+
- name: exported
99+
disabled: true
100+
- name: if-return
101+
- name: increment-decrement
102+
- name: var-naming
103+
- name: var-declaration
104+
- name: package-comments
105+
disabled: true
106+
- name: range
107+
- name: receiver-naming
108+
- name: time-naming
109+
- name: unexported-return
110+
- name: indent-error-flow
111+
- name: errorf
112+
- name: empty-block
113+
- name: superfluous-else
114+
- name: unused-parameter
115+
disabled: true
116+
- name: unreachable-code
117+
- name: redefines-builtin-id
118+
119+
exclusions:
120+
warn-unused: true
82121
rules:
83-
- name: struct-tag
84-
- name: blank-imports
85-
- name: context-as-argument
86-
- name: context-keys-type
87-
- name: dot-imports
88-
- name: error-return
89-
- name: error-strings
90-
- name: error-naming
91-
- name: exported
92-
disabled: true
93-
- name: if-return
94-
- name: increment-decrement
95-
- name: var-naming
96-
- name: var-declaration
97-
- name: package-comments
98-
disabled: true
99-
- name: range
100-
- name: receiver-naming
101-
- name: time-naming
102-
- name: unexported-return
103-
- name: indent-error-flow
104-
- name: errorf
105-
- name: empty-block
106-
- name: superfluous-else
107-
- name: unused-parameter
108-
disabled: true
109-
- name: unreachable-code
110-
- name: redefines-builtin-id
122+
- linters:
123+
- tagalign
124+
path: internal/traefik/
111125

112126
issues:
113-
exclude-use-default: false
114127
max-issues-per-linter: 0
115128
max-same-issues: 0
116-
exclude-rules:
117-
- path: internal/traefik/
118-
linters:
119-
- tagalign
120-
121-
run:
122-
timeout: 5m

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ func (c cleaner) clean(config configuration, data map[string]*traefik.StoredData
166166
toRevoke = append(toRevoke, cert)
167167
continue
168168
}
169-
if strings.HasSuffix(cert.Certificate.Domain.Main, config.Domain) || containsSuffixes(cert.Certificate.Domain.SANs, config.Domain) {
169+
if strings.HasSuffix(cert.Domain.Main, config.Domain) || containsSuffixes(cert.Domain.SANs, config.Domain) {
170170
toRevoke = append(toRevoke, cert)
171171
continue
172172
}

0 commit comments

Comments
 (0)