File tree Expand file tree Collapse file tree 6 files changed +38
-14
lines changed Expand file tree Collapse file tree 6 files changed +38
-14
lines changed Original file line number Diff line number Diff line change @@ -3536,28 +3536,36 @@ linters-settings:
35363536 constant-kind : true
35373537
35383538 usetesting :
3539- # Enable/disable `context.Background()` detections.
3540- # Disabled if Go < 1.24.
3539+ # Enable/disable `os.CreateTemp("", ...)` detections.
35413540 # Default: true
3542- context-background : false
3541+ os-create-temp : false
35433542
3544- # Enable/disable `context.TODO()` detections.
3545- # Disabled if Go < 1.24.
3543+ # Enable/disable `os.MkdirTemp()` detections.
35463544 # Default: true
3547- context-todo : false
3545+ os-mkdir-temp : false
3546+
3547+ # Enable/disable `os.Setenv()` detections.
3548+ # Default: false
3549+ os-setenv : true
3550+
3551+ # Enable/disable `os.TempDir()` detections.
3552+ # Default: false
3553+ os-temp-dir : true
35483554
35493555 # Enable/disable `os.Chdir()` detections.
35503556 # Disabled if Go < 1.24.
35513557 # Default: true
35523558 os-chdir : false
35533559
3554- # Enable/disable `os.MkdirTemp()` detections.
3560+ # Enable/disable `context.Background()` detections.
3561+ # Disabled if Go < 1.24.
35553562 # Default: true
3556- os-mkdir-temp : false
3563+ context-background : false
35573564
3558- # Enable/disable `os.Setenv()` detections.
3559- # Default: false
3560- os-setenv : true
3565+ # Enable/disable `context.TODO()` detections.
3566+ # Disabled if Go < 1.24.
3567+ # Default: true
3568+ context-todo : false
35613569
35623570 unconvert :
35633571 # Remove conversions that force intermediate rounding.
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ require (
6868 github.com/lasiar/canonicalheader v1.1.2
6969 github.com/ldez/gomoddirectives v0.2.4
7070 github.com/ldez/tagliatelle v0.6.0
71- github.com/ldez/usetesting v0.1 .0
71+ github.com/ldez/usetesting v0.2 .0
7272 github.com/leonklingele/grouper v1.1.2
7373 github.com/macabu/inamedparam v0.1.3
7474 github.com/maratori/testableexamples v1.0.0
Original file line number Diff line number Diff line change 428428 " unparam" ,
429429 " unused" ,
430430 " usestdlibvars" ,
431+ " usetesting" ,
431432 " varnamelen" ,
432433 " wastedassign" ,
433434 " whitespace" ,
33483349 "os-setenv" : {
33493350 "type" : " boolean" ,
33503351 "default" : false
3352+ },
3353+ "os-create-temp" : {
3354+ "type" : " boolean" ,
3355+ "default" : true
3356+ },
3357+ "os-temp-dir" : {
3358+ "type" : " boolean" ,
3359+ "default" : false
33513360 }
33523361 }
33533362 },
Original file line number Diff line number Diff line change @@ -184,6 +184,9 @@ var defaultLintersSettings = LintersSettings{
184184 ContextTodo : true ,
185185 OSChdir : true ,
186186 OSMkdirTemp : true ,
187+ OSSetenv : false ,
188+ OSTempDir : false ,
189+ OSSCreateTemp : true ,
187190 },
188191 Varnamelen : VarnamelenSettings {
189192 MaxDistance : 5 ,
@@ -972,6 +975,8 @@ type UseTestingSettings struct {
972975 OSChdir bool `mapstructure:"os-chdir"`
973976 OSMkdirTemp bool `mapstructure:"os-mkdir-temp"`
974977 OSSetenv bool `mapstructure:"os-setenv"`
978+ OSTempDir bool `mapstructure:"os-temp-dir"`
979+ OSSCreateTemp bool `mapstructure:"os-create-temp"`
975980}
976981
977982type UnconvertSettings struct {
Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ func New(settings *config.UseTestingSettings) *goanalysis.Linter {
1919 "oschdir" : settings .OSChdir ,
2020 "osmkdirtemp" : settings .OSMkdirTemp ,
2121 "ossetenv" : settings .OSSetenv ,
22+ "ostempdir" : settings .OSTempDir ,
23+ "oscreatetemp" : settings .OSSCreateTemp ,
2224 }
2325 }
2426
You can’t perform that action at this time.
0 commit comments