Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9da60a9

Browse files
authored
chore: migrate from tenv linter to usetesting linter (#20401)
The tenv linter is deprecated in favor of usetesting which offers asuperset of lint checks. This message is seen when running `make lint````[nix-shell:~/src/coder]$ make lint<snip>WARN The linter 'tenv' is deprecated (since v1.64.0) due to: Duplicate feature in another linter. Replaced by usetesting.<snip>```This change swaps out the deprecated tenv linter for the usetesting linter,and configures it for linting parity.#20398
1 parente73f9d3 commit9da60a9

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

‎.golangci.yaml‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,16 @@ linters-settings:
169169
-name:var-declaration
170170
-name:var-naming
171171
-name:waitgroup-by-value
172+
usetesting:
173+
# Only os-setenv is enabled because we migrated to usetesting from another linter that
174+
# only covered os-setenv.
175+
os-setenv:true
176+
os-create-temp:false
177+
os-mkdir-temp:false
178+
os-temp-dir:false
179+
os-chdir:false
180+
context-background:false
181+
context-todo:false
172182

173183
# irrelevant as of Go v1.22: https://go.dev/blog/loopvar-preview
174184
govet:
@@ -252,7 +262,6 @@ linters:
252262
# - wastedassign
253263

254264
-staticcheck
255-
-tenv
256265
# In Go, it's possible for a package to test it's internal functionality
257266
# without testing any exported functions. This is enabled to promote
258267
# decomposing a package before testing it's internals. A function caller
@@ -265,4 +274,5 @@ linters:
265274
-typecheck
266275
-unconvert
267276
-unused
277+
-usetesting
268278
-dupl

‎coderd/util/tz/tz_test.go‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,9 @@ func Test_TimezoneIANA(t *testing.T) {
3535
// This test can be flaky on some Windows runners :(
3636
t.Skip("This test is flaky under Windows.")
3737
}
38-
oldEnv,found:=os.LookupEnv("TZ")
38+
_,found:=os.LookupEnv("TZ")
3939
iffound {
4040
require.NoError(t,os.Unsetenv("TZ"))
41-
t.Cleanup(func() {
42-
_=os.Setenv("TZ",oldEnv)
43-
})
4441
}
4542

4643
zone,err:=tz.TimezoneIANA()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp