Skip to content

tenv: deprecation #5373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .golangci.next.reference.yml
Original file line number Diff line number Diff line change
@@ -106,7 +106,6 @@ linters:
- stylecheck
- tagalign
- tagliatelle
- tenv
- testableexamples
- testifylint
- testpackage
@@ -225,7 +224,6 @@ linters:
- stylecheck
- tagalign
- tagliatelle
- tenv
- testableexamples
- testifylint
- testpackage
@@ -245,13 +243,14 @@ linters:
- deadcode # Deprecated
- exhaustivestruct # Deprecated
- golint # Deprecated
- gomnd # Deprecated
- ifshort # Deprecated
- interfacer # Deprecated
- maligned # Deprecated
- gomnd # Deprecated
- nosnakecase # Deprecated
- scopelint # Deprecated
- structcheck # Deprecated
- tenv # Deprecated
- varcheck # Deprecated

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

# Enable/disable `os.Setenv()` detections.
# Default: false
os-setenv: true
# Default: true
os-setenv: false

# Enable/disable `os.TempDir()` detections.
# Default: false
2 changes: 1 addition & 1 deletion jsonschema/golangci.next.jsonschema.json
Original file line number Diff line number Diff line change
@@ -3488,7 +3488,7 @@
},
"os-setenv": {
"type": "boolean",
"default": false
"default": true
},
"os-create-temp": {
"type": "boolean",
2 changes: 1 addition & 1 deletion pkg/config/linters_settings.go
Original file line number Diff line number Diff line change
@@ -183,7 +183,7 @@ var defaultLintersSettings = LintersSettings{
ContextTodo: true,
OSChdir: true,
OSMkdirTemp: true,
OSSetenv: false,
OSSetenv: true,
OSTempDir: false,
OSCreateTemp: true,
},
2 changes: 1 addition & 1 deletion pkg/golinters/usetesting/testdata/usetesting.go
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ func Test_osMkdirTemp(t *testing.T) {
}

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

func Test_osTempDir(t *testing.T) {
3 changes: 2 additions & 1 deletion pkg/lint/lintersdb/builder_linter.go
Original file line number Diff line number Diff line change
@@ -769,7 +769,8 @@ func (LinterBuilder) Build(cfg *config.Config) ([]*linter.Config, error) {
WithSince("v1.43.0").
WithPresets(linter.PresetTest).
WithLoadForGoAnalysis().
WithURL("https://github.com/sivchari/tenv"),
WithURL("https://github.com/sivchari/tenv").
DeprecatedWarning("Duplicate feature another linter.", "v1.64.0", "usetesting"),

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