mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
chore: migrate from tenv linter to usetesting linter (#20401)
The tenv linter is deprecated in favor of usetesting which offers a superset 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. https://github.com/coder/coder/issues/20398
This commit is contained in:
+11
-1
@@ -169,6 +169,16 @@ linters-settings:
|
||||
- name: var-declaration
|
||||
- name: var-naming
|
||||
- name: waitgroup-by-value
|
||||
usetesting:
|
||||
# Only os-setenv is enabled because we migrated to usetesting from another linter that
|
||||
# only covered os-setenv.
|
||||
os-setenv: true
|
||||
os-create-temp: false
|
||||
os-mkdir-temp: false
|
||||
os-temp-dir: false
|
||||
os-chdir: false
|
||||
context-background: false
|
||||
context-todo: false
|
||||
|
||||
# irrelevant as of Go v1.22: https://go.dev/blog/loopvar-preview
|
||||
govet:
|
||||
@@ -252,7 +262,6 @@ linters:
|
||||
# - wastedassign
|
||||
|
||||
- staticcheck
|
||||
- tenv
|
||||
# In Go, it's possible for a package to test it's internal functionality
|
||||
# without testing any exported functions. This is enabled to promote
|
||||
# decomposing a package before testing it's internals. A function caller
|
||||
@@ -265,4 +274,5 @@ linters:
|
||||
- typecheck
|
||||
- unconvert
|
||||
- unused
|
||||
- usetesting
|
||||
- dupl
|
||||
|
||||
Reference in New Issue
Block a user