Skip to content

Commit 49b65f1

Browse files
committed
fix lint
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
1 parent 184bf0f commit 49b65f1

4 files changed

Lines changed: 29 additions & 19 deletions

File tree

.github/workflows/ci-build.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ jobs:
110110
- name: Run golangci-lint
111111
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
112112
with:
113-
# renovate: datasource=go packageName=github.com/golangci/golangci-lint versioning=regex:^v(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)?$
114-
version: v2.5.0
113+
# renovate: datasource=go packageName=github.com/golangci/golangci-lint/v2 versioning=regex:^v(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)?$
114+
version: v2.11.4
115115
args: --verbose
116116

117117
test-go:

.golangci.yaml

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ linters:
2222
- govet
2323
- importas
2424
- misspell
25+
- modernize
2526
- noctx
2627
- perfsprint
2728
- revive
@@ -121,6 +122,13 @@ linters:
121122
- pkg: github.com/argoproj/argo-cd/v3/util/io
122123
alias: utilio
123124

125+
modernize:
126+
disable:
127+
# Suggest replacing omitempty with omitzero for struct fields.
128+
- omitzero
129+
# Simplify code by using go1.26's new(expr). - generates lots of false positives.
130+
- newexpr
131+
124132
nolintlint:
125133
require-specific: true
126134

@@ -137,16 +145,19 @@ linters:
137145
strconcat: true
138146

139147
revive:
148+
enable-all-rules: false
149+
enable-default-rules: true
150+
max-open-files: 2048
140151
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md
141152
rules:
142-
- name: bool-literal-in-expr
143-
144153
- name: blank-imports
145154
disabled: true
146155

156+
- name: bool-literal-in-expr
157+
147158
- name: context-as-argument
148159
arguments:
149-
- allowTypesBefore: '*testing.T,testing.TB'
160+
- allow-types-before: '*testing.T,testing.TB'
150161

151162
- name: context-keys-type
152163
disabled: true
@@ -158,21 +169,21 @@ linters:
158169

159170
- name: early-return
160171
arguments:
161-
- preserveScope
172+
- preserve-scope
162173

163174
- name: empty-block
164175
disabled: true
165176

166-
- name: error-naming
167-
disabled: true
168-
169177
- name: error-return
170178

171179
- name: error-strings
172180
disabled: true
173181

174182
- name: errorf
175183

184+
- name: exported
185+
disabled: true
186+
176187
- name: identical-branches
177188

178189
- name: if-return
@@ -181,7 +192,7 @@ linters:
181192

182193
- name: indent-error-flow
183194
arguments:
184-
- preserveScope
195+
- preserve-scope
185196

186197
- name: modifies-parameter
187198

@@ -198,7 +209,7 @@ linters:
198209

199210
- name: superfluous-else
200211
arguments:
201-
- preserveScope
212+
- preserve-scope
202213

203214
- name: time-equal
204215

@@ -208,6 +219,8 @@ linters:
208219
- name: unexported-return
209220
disabled: true
210221

222+
- name: unnecessary-format
223+
211224
- name: unnecessary-stmt
212225

213226
- name: unreachable-code
@@ -224,8 +237,8 @@ linters:
224237
arguments:
225238
- - ID
226239
- - VM
227-
- - skipPackageNameChecks: true
228-
upperCaseConst: true
240+
- - skip-initialism-name-checks: true
241+
upper-case-const: true
229242

230243
staticcheck:
231244
checks:
@@ -247,7 +260,4 @@ linters:
247260
usetesting:
248261
os-mkdir-temp: false
249262

250-
output:
251-
show-stats: false
252-
253263
version: "2"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
set -eux -o pipefail
33

4-
# renovate: datasource=go packageName=github.com/golangci/golangci-lint
5-
GOLANGCI_LINT_VERSION=2.5.0
4+
# renovate: datasource=go packageName=github.com/golangci/golangci-lint/v2
5+
GOLANGCI_LINT_VERSION=2.11.4
66

77
GO111MODULE=on go install "github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v${GOLANGCI_LINT_VERSION}"

renovate-presets/devtool.json5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"go"
1717
],
1818
"matchPackageNames": [
19-
"github.com/golangci/golangci-lint",
19+
"github.com/golangci/golangci-lint/v2",
2020
"github.com/vektra/mockery/v3"
2121
],
2222
"enabled": true

0 commit comments

Comments
 (0)