golangci-lint: replace deprecated tenv
linter in favor of usetesting
WARN The linter 'tenv' is deprecated (since v1.64.0) due to: Duplicate feature another linter. Replaced by usetesting. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
3e9fa43ef8
commit
a8affefeea
@ -27,7 +27,6 @@ linters:
|
|||||||
- revive # Metalinter; drop-in replacement for golint.
|
- revive # Metalinter; drop-in replacement for golint.
|
||||||
- staticcheck
|
- staticcheck
|
||||||
- stylecheck # Replacement for golint
|
- stylecheck # Replacement for golint
|
||||||
- tenv # Detects using os.Setenv instead of t.Setenv.
|
|
||||||
- thelper # Detects test helpers without t.Helper().
|
- thelper # Detects test helpers without t.Helper().
|
||||||
- tparallel # Detects inappropriate usage of t.Parallel().
|
- tparallel # Detects inappropriate usage of t.Parallel().
|
||||||
- typecheck
|
- typecheck
|
||||||
@ -35,6 +34,7 @@ linters:
|
|||||||
- unparam
|
- unparam
|
||||||
- unused
|
- unused
|
||||||
- usestdlibvars
|
- usestdlibvars
|
||||||
|
- usetesting # Reports uses of functions with replacement inside the testing package.
|
||||||
- wastedassign
|
- wastedassign
|
||||||
|
|
||||||
disable:
|
disable:
|
||||||
@ -43,6 +43,8 @@ linters:
|
|||||||
run:
|
run:
|
||||||
# prevent golangci-lint from deducting the go version to lint for through go.mod,
|
# prevent golangci-lint from deducting the go version to lint for through go.mod,
|
||||||
# which causes it to fallback to go1.17 semantics.
|
# which causes it to fallback to go1.17 semantics.
|
||||||
|
#
|
||||||
|
# TODO(thaJeztah): update "usetesting" settings to enable go1.24 features once our minimum version is go1.24
|
||||||
go: "1.23.6"
|
go: "1.23.6"
|
||||||
timeout: 5m
|
timeout: 5m
|
||||||
|
|
||||||
@ -103,6 +105,14 @@ linters-settings:
|
|||||||
severity: warning
|
severity: warning
|
||||||
disabled: false
|
disabled: false
|
||||||
|
|
||||||
|
usetesting:
|
||||||
|
# FIXME(thaJeztah): Disable `os.Chdir()` detections; should be automatically disabled on Go < 1.24; see https://github.com/docker/cli/pull/5835#issuecomment-2665302478
|
||||||
|
os-chdir: false
|
||||||
|
# FIXME(thaJeztah): Disable `context.Background()` detections; should be automatically disabled on Go < 1.24; see https://github.com/docker/cli/pull/5835#issuecomment-2665302478
|
||||||
|
context-background: false
|
||||||
|
# FIXME(thaJeztah): Disable `context.TODO()` detections; should be automatically disabled on Go < 1.24; see https://github.com/docker/cli/pull/5835#issuecomment-2665302478
|
||||||
|
context-todo: false
|
||||||
|
|
||||||
issues:
|
issues:
|
||||||
# The default exclusion rules are a bit too permissive, so copying the relevant ones below
|
# The default exclusion rules are a bit too permissive, so copying the relevant ones below
|
||||||
exclude-use-default: false
|
exclude-use-default: false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user