Skip to content

Commit 242ebf1

Browse files
committed
varnamelen: explicit default values
1 parent e3d0247 commit 242ebf1

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

.golangci.example.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1057,19 +1057,19 @@ 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)
10671067
check-return: false
1068-
# Ignore "ok" variables that hold the bool return value of a type assertion. (defaults to false)
1068+
# Ignore "ok" variables that hold the bool return value of a type assertion. (defaults to true)
10691069
ignore-type-assert-ok: false
1070-
# Ignore "ok" variables that hold the bool return value of a map index. (defaults to false)
1070+
# Ignore "ok" variables that hold the bool return value of a map index. (defaults to true)
10711071
ignore-map-index-ok: false
1072-
# Ignore "ok" variables that hold the bool return value of a channel receive. (defaults to false)
1072+
# Ignore "ok" variables that hold the bool return value of a channel receive. (defaults to true)
10731073
ignore-chan-recv-ok: false
10741074
# Optional list of variable names that should be ignored completely. (defaults to empty list)
10751075
ignore-names:

pkg/config/linters_settings.go

+7
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ var defaultLintersSettings = LintersSettings{
8181
Unparam: UnparamSettings{
8282
Algo: "cha",
8383
},
84+
Varnamelen: VarnamelenSettings{
85+
MaxDistance: 5,
86+
MinNameLength: 3,
87+
IgnoreTypeAssertOk: true,
88+
IgnoreMapIndexOk: true,
89+
IgnoreChanRecvOk: true,
90+
},
8491
WSL: WSLSettings{
8592
StrictAppend: true,
8693
AllowAssignAndCallCuddle: true,

0 commit comments

Comments
 (0)