Skip to content

Commit e44377f

Browse files
Merge pull request #98 from Icinga/dependabot/github_actions/golangci/golangci-lint-action-7
Bump golangci/golangci-lint-action from 6 to 7
2 parents b626706 + 6afbc25 commit e44377f

File tree

5 files changed

+50
-21
lines changed

5 files changed

+50
-21
lines changed

.github/workflows/golangci-lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ jobs:
1515
- uses: actions/checkout@v4
1616

1717
- name: golangci-lint
18-
uses: golangci/golangci-lint-action@v6
18+
uses: golangci/golangci-lint-action@v7
1919
with:
20-
version: v1.64.6
20+
version: v2.0.2
2121

2222
- name: Go mod tidy
2323
run: |

.golangci.yml

Lines changed: 44 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,58 @@
1-
run:
2-
timeout: 5m
3-
4-
issues:
5-
exclude-files:
6-
- '(.+)_test\.go'
7-
- 'internal/config/http_config.go'
8-
- 'internal/config/config.go'
1+
version: "2"
92
linters:
10-
disable-all: false
113
enable:
4+
- asasalint
5+
- asciicheck
6+
- bidichk
127
- dogsled
138
- dupl
9+
- durationcheck
10+
- errchkjson
11+
- errorlint
12+
- exhaustive
13+
- gocheckcompilerdirectives
14+
- gochecksumtype
15+
- gosec
16+
- gosmopolitan
17+
- loggercheck
18+
- makezero
19+
- nilnesserr
20+
- protogetter
21+
- reassign
22+
- recvcheck
23+
- spancheck
24+
- testifylint
1425
- whitespace
1526
- wsl
27+
- zerologlint
1628
disable:
17-
- funlen
1829
- bodyclose
1930
- contextcheck
31+
- funlen
32+
- musttag
2033
- nilerr
2134
- noctx
2235
- rowserrcheck
2336
- sqlclosecheck
2437
- unparam
25-
- musttag
26-
presets:
27-
- bugs
28-
- unused
29-
fast: false
38+
exclusions:
39+
generated: lax
40+
presets:
41+
- comments
42+
- common-false-positives
43+
- legacy
44+
- std-error-handling
45+
paths:
46+
- (.+)_test\.go
47+
- internal/config/http_config.go
48+
- internal/config/config.go
49+
- third_party$
50+
- builtin$
51+
- examples$
52+
formatters:
53+
exclusions:
54+
generated: lax
55+
paths:
56+
- third_party$
57+
- builtin$
58+
- examples$

check.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ func (c *Config) BuildCommand() (cmd string) {
183183
return
184184
}
185185

186-
func (c *Config) Run(timeout time.Duration) (err error, rc int, output string) {
186+
func (c *Config) Run(timeout time.Duration) (rc int, output string, err error) {
187187
if !c.validated {
188188
panic("you need to call Validate() before Run()")
189189
}

check_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func TestConfig_Run_WithError(t *testing.T) {
5959
err := c.Validate()
6060
assert.NoError(t, err)
6161

62-
err, _, _ = c.Run(1 * time.Second)
62+
_, _, err = c.Run(1 * time.Second)
6363
assert.Error(t, err)
6464
assert.Contains(t, err.Error(), "dial tcp 192.0.2.11:")
6565
}
@@ -145,7 +145,7 @@ func runCheck(t *testing.T, c *Config) {
145145
err := c.Validate()
146146
assert.NoError(t, err)
147147

148-
err, rc, output := c.Run(DefaultTimeout)
148+
rc, output, err := c.Run(DefaultTimeout)
149149
assert.NoError(t, err)
150150
assert.Equal(t, 0, rc)
151151
assert.Contains(t, output, "ConsoleHost")

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func main() {
6060
check.ExitRaw(check.Unknown, "could not validate parameters: "+err.Error())
6161
}
6262

63-
err, rc, output := config.Run(time.Duration(plugin.Timeout) * time.Second)
63+
rc, output, err := config.Run(time.Duration(plugin.Timeout) * time.Second)
6464
if err != nil {
6565
check.ExitRaw(check.Unknown, "execution failed: "+err.Error())
6666
}

0 commit comments

Comments
 (0)