Skip to content

Commit dff995c

Browse files
authored
varnamelen: explicit default values (#2496)
1 parent e3d0247 commit dff995c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.golangci.example.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1057,10 +1057,10 @@ linters-settings:
10571057
varnamelen:
10581058
# The longest distance, in source lines, that is being considered a "small scope." (defaults to 5)
10591059
# Variables used in at most this many lines will be ignored.
1060-
max-distance: 5
1060+
max-distance: 6
10611061
# The minimum length of a variable's name that is considered "long." (defaults to 3)
10621062
# Variable names that are at least this long will be ignored.
1063-
min-name-length: 3
1063+
min-name-length: 2
10641064
# Check method receiver names. (defaults to false)
10651065
check-receiver: false
10661066
# Check named return values. (defaults to false)

pkg/config/linters_settings.go

+4
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ var defaultLintersSettings = LintersSettings{
8181
Unparam: UnparamSettings{
8282
Algo: "cha",
8383
},
84+
Varnamelen: VarnamelenSettings{
85+
MaxDistance: 5,
86+
MinNameLength: 3,
87+
},
8488
WSL: WSLSettings{
8589
StrictAppend: true,
8690
AllowAssignAndCallCuddle: true,

0 commit comments

Comments
 (0)