Skip to content

Commit d2e38d0

Browse files
butuzovSeigeC
authored andcommitted
varnamelen: explicit default values (golangci#2496)
1 parent 7087821 commit d2e38d0

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
@@ -1062,10 +1062,10 @@ linters-settings:
10621062
varnamelen:
10631063
# The longest distance, in source lines, that is being considered a "small scope." (defaults to 5)
10641064
# Variables used in at most this many lines will be ignored.
1065-
max-distance: 5
1065+
max-distance: 6
10661066
# The minimum length of a variable's name that is considered "long." (defaults to 3)
10671067
# Variable names that are at least this long will be ignored.
1068-
min-name-length: 3
1068+
min-name-length: 2
10691069
# Check method receiver names. (defaults to false)
10701070
check-receiver: false
10711071
# 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)