File tree 6 files changed +34
-15
lines changed
6 files changed +34
-15
lines changed Original file line number Diff line number Diff line change @@ -3536,28 +3536,31 @@ linters-settings:
3536
3536
constant-kind : true
3537
3537
3538
3538
usetesting :
3539
- # Enable/disable `context.Background()` detections.
3540
- # Disabled if Go < 1.24.
3539
+ # Enable/disable `os.CreateTemp("", ...)` detections.
3541
3540
# Default: true
3542
- context-background : false
3541
+ os-create-temp : false
3543
3542
3544
- # Enable/disable `context.TODO()` detections.
3545
- # Disabled if Go < 1.24.
3543
+ # Enable/disable `os.MkdirTemp()` detections.
3546
3544
# 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
3548
3554
3549
3555
# Enable/disable `os.Chdir()` detections.
3550
3556
# Disabled if Go < 1.24.
3551
3557
# Default: true
3552
3558
os-chdir : false
3553
3559
3554
- # Enable/disable `os.MkdirTemp()` detections.
3560
+ # Enable/disable `context.Background()` detections.
3561
+ # Disabled if Go < 1.24.
3555
3562
# Default: true
3556
- os-mkdir-temp : false
3557
-
3558
- # Enable/disable `os.Setenv()` detections.
3559
- # Default: false
3560
- os-setenv : true
3563
+ context-background : false
3561
3564
3562
3565
unconvert :
3563
3566
# Remove conversions that force intermediate rounding.
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ require (
68
68
github.com/lasiar/canonicalheader v1.1.2
69
69
github.com/ldez/gomoddirectives v0.2.4
70
70
github.com/ldez/tagliatelle v0.6.0
71
- github.com/ldez/usetesting v0.1 .0
71
+ github.com/ldez/usetesting v0.2 .0
72
72
github.com/leonklingele/grouper v1.1.2
73
73
github.com/macabu/inamedparam v0.1.3
74
74
github.com/maratori/testableexamples v1.0.0
Original file line number Diff line number Diff line change 428
428
" unparam" ,
429
429
" unused" ,
430
430
" usestdlibvars" ,
431
+ " usetesting" ,
431
432
" varnamelen" ,
432
433
" wastedassign" ,
433
434
" whitespace" ,
3348
3349
"os-setenv" : {
3349
3350
"type" : " boolean" ,
3350
3351
"default" : false
3352
+ },
3353
+ "os-create-temp" : {
3354
+ "type" : " boolean" ,
3355
+ "default" : true
3356
+ },
3357
+ "os-temp-dir" : {
3358
+ "type" : " boolean" ,
3359
+ "default" : false
3351
3360
}
3352
3361
}
3353
3362
},
Original file line number Diff line number Diff line change @@ -184,6 +184,9 @@ var defaultLintersSettings = LintersSettings{
184
184
ContextTodo : true ,
185
185
OSChdir : true ,
186
186
OSMkdirTemp : true ,
187
+ OSSetenv : false ,
188
+ OSTempDir : false ,
189
+ OSSCreateTemp : true ,
187
190
},
188
191
Varnamelen : VarnamelenSettings {
189
192
MaxDistance : 5 ,
@@ -972,6 +975,8 @@ type UseTestingSettings struct {
972
975
OSChdir bool `mapstructure:"os-chdir"`
973
976
OSMkdirTemp bool `mapstructure:"os-mkdir-temp"`
974
977
OSSetenv bool `mapstructure:"os-setenv"`
978
+ OSTempDir bool `mapstructure:"os-temp-dir"`
979
+ OSSCreateTemp bool `mapstructure:"os-create-temp"`
975
980
}
976
981
977
982
type UnconvertSettings struct {
Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ func New(settings *config.UseTestingSettings) *goanalysis.Linter {
19
19
"oschdir" : settings .OSChdir ,
20
20
"osmkdirtemp" : settings .OSMkdirTemp ,
21
21
"ossetenv" : settings .OSSetenv ,
22
+ "ostempdir" : settings .OSTempDir ,
23
+ "oscreatetemp" : settings .OSSCreateTemp ,
22
24
}
23
25
}
24
26
You can’t perform that action at this time.
0 commit comments