Skip to content

Commit 5411ee2

Browse files
jorbaumchombium
authored andcommitted
Upgrade to golangci-lint v2 for improved linting
Noteworthy changes in golangci-lint v2: * New config format (migrated with `migrate` command) * Default timeout is now 0 instead of 1 minute.
1 parent cce0fcd commit 5411ee2

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

scripts/subtests/lint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ set +e
99
golangci_lint_executable=$(which golangci-lint)
1010
set -e
1111
if [ -z "${golangci_lint_executable}" ] || [ ! -x "${golangci_lint_executable}" ]; then
12-
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
12+
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
1313
fi
1414

1515
pushd "${SCRIPT_DIR}/../../src" > /dev/null

src/.golangci.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
version: "2"
2+
13
run:
24
# Timeout for analysis, e.g. 30s, 5m.
35
# Default: 1m
@@ -11,11 +13,31 @@ linters:
1113
- gocyclo
1214
# Inspects source code for security problems.
1315
- gosec
14-
# Checks code formatting
15-
- goimports
16+
exclusions:
17+
generated: lax
18+
presets:
19+
- comments
20+
- common-false-positives
21+
- legacy
22+
- std-error-handling
23+
paths:
24+
- third_party$
25+
- builtin$
26+
- examples$
1627

1728
issues:
1829
# Disable max issues per linter.
1930
max-issues-per-linter: 0
2031
# Disable max same issues.
2132
max-same-issues: 0
33+
34+
formatters:
35+
enable:
36+
# Checks code formatting
37+
- goimports
38+
exclusions:
39+
generated: lax
40+
paths:
41+
- third_party$
42+
- builtin$
43+
- examples$

0 commit comments

Comments
 (0)