Skip to content

Commit 0284fa9

Browse files
authored
tenv: deprecation (#5373)
1 parent a2ef9ee commit 0284fa9

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

.golangci.next.reference.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ linters:
106106
- stylecheck
107107
- tagalign
108108
- tagliatelle
109-
- tenv
110109
- testableexamples
111110
- testifylint
112111
- testpackage
@@ -225,7 +224,6 @@ linters:
225224
- stylecheck
226225
- tagalign
227226
- tagliatelle
228-
- tenv
229227
- testableexamples
230228
- testifylint
231229
- testpackage
@@ -245,13 +243,14 @@ linters:
245243
- deadcode # Deprecated
246244
- exhaustivestruct # Deprecated
247245
- golint # Deprecated
246+
- gomnd # Deprecated
248247
- ifshort # Deprecated
249248
- interfacer # Deprecated
250249
- maligned # Deprecated
251-
- gomnd # Deprecated
252250
- nosnakecase # Deprecated
253251
- scopelint # Deprecated
254252
- structcheck # Deprecated
253+
- tenv # Deprecated
255254
- varcheck # Deprecated
256255

257256
# Enable presets.
@@ -3656,8 +3655,8 @@ linters-settings:
36563655
os-mkdir-temp: false
36573656

36583657
# Enable/disable `os.Setenv()` detections.
3659-
# Default: false
3660-
os-setenv: true
3658+
# Default: true
3659+
os-setenv: false
36613660

36623661
# Enable/disable `os.TempDir()` detections.
36633662
# Default: false

jsonschema/golangci.next.jsonschema.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3488,7 +3488,7 @@
34883488
},
34893489
"os-setenv": {
34903490
"type": "boolean",
3491-
"default": false
3491+
"default": true
34923492
},
34933493
"os-create-temp": {
34943494
"type": "boolean",

pkg/config/linters_settings.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ var defaultLintersSettings = LintersSettings{
183183
ContextTodo: true,
184184
OSChdir: true,
185185
OSMkdirTemp: true,
186-
OSSetenv: false,
186+
OSSetenv: true,
187187
OSTempDir: false,
188188
OSCreateTemp: true,
189189
},

pkg/golinters/usetesting/testdata/usetesting.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ func Test_osMkdirTemp(t *testing.T) {
1111
}
1212

1313
func Test_osSetenv(t *testing.T) {
14-
os.Setenv("", "")
14+
os.Setenv("", "") // want `os\.Setenv\(\) could be replaced by t\.Setenv\(\) in .+`
1515
}
1616

1717
func Test_osTempDir(t *testing.T) {

pkg/lint/lintersdb/builder_linter.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,8 @@ func (LinterBuilder) Build(cfg *config.Config) ([]*linter.Config, error) {
769769
WithSince("v1.43.0").
770770
WithPresets(linter.PresetTest).
771771
WithLoadForGoAnalysis().
772-
WithURL("https://github.com/sivchari/tenv"),
772+
WithURL("https://github.com/sivchari/tenv").
773+
DeprecatedWarning("Duplicate feature another linter.", "v1.64.0", "usetesting"),
773774

774775
linter.NewConfig(testableexamples.New()).
775776
WithSince("v1.50.0").

0 commit comments

Comments
 (0)