Skip to content

Commit 62c3e6a

Browse files
committed
Migrate golangci-lint configuration from v1 to v2
1 parent ece997c commit 62c3e6a

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

.golangci.yml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,31 @@
1+
version: "2"
2+
13
linters:
2-
# Disable all defaults, then enable individual linters explicitely
3-
disable-all: true
4+
# Disable all linters by default, then enable individual linters explicitly.
5+
default: none
46
enable:
5-
# Enable the ones that are by default
7+
# Enable the ones that are by default.
68
- errcheck
7-
- gosimple
89
- govet
910
- ineffassign
1011
- staticcheck
1112
- unused
12-
# Enable remaining linters required to match checks performed by stand-alone staticcheck tool (corresponds to: staticcheck, stylecheck, gosimple and unused)
13-
- stylecheck
1413
# Add some additional linters
15-
- goimports
16-
- revive
17-
- unconvert
1814
- misspell
1915
- prealloc
16+
- revive
17+
- unconvert
2018

21-
issues:
22-
# Enable some lints excluded by default
23-
exclude-use-default: false
19+
formatters:
20+
enable:
21+
- goimports
2422

23+
issues:
2524
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
2625
max-issues-per-linter: 0
27-
2826
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
2927
max-same-issues: 0
3028

3129
run:
32-
# Timeout for analysis, e.g. 30s, 5m. Default is 1m.
33-
timeout: 3m
30+
# Timeout for total work, e.g. 30s, 5m, 5m30s. Default is 0 (disabled).
31+
timeout: 3m

npiperelay.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ import (
1919

2020
// How long to sleep between failures while polling
2121
const (
22-
cSECURITY_SQOS_PRESENT = 0x100000 //nolint:revive,stylecheck // Don't include revive and stylecheck when running golangci-lint to stop complain about use of underscores in Go names
23-
cSECURITY_ANONYMOUS = 0 //nolint:revive,stylecheck // Don't include revive and stylecheck when running golangci-lint to stop complain about use of underscores in Go names
24-
cPOLL_TIMEOUT = 200 * time.Millisecond //nolint:revive,stylecheck // Don't include revive and stylecheck when running golangci-lint to stop complain about use of underscores in Go names
25-
cPOLL_ATTEMPTS = 300 //nolint:revive,stylecheck // Don't include revive and stylecheck when running golangci-lint to stop complain about use of underscores in Go names
22+
cSECURITY_SQOS_PRESENT = 0x100000 //nolint:revive // Don't include revive when running golangci-lint to stop complain about use of underscores in Go names
23+
cSECURITY_ANONYMOUS = 0 //nolint:revive // Don't include revive when running golangci-lint to stop complain about use of underscores in Go names
24+
cPOLL_TIMEOUT = 200 * time.Millisecond //nolint:revive // Don't include revive when running golangci-lint to stop complain about use of underscores in Go names
25+
cPOLL_ATTEMPTS = 300 //nolint:revive // Don't include revive when running golangci-lint to stop complain about use of underscores in Go names
2626
)
2727

2828
var (

0 commit comments

Comments
 (0)