File tree Expand file tree Collapse file tree 3 files changed +42
-3
lines changed Expand file tree Collapse file tree 3 files changed +42
-3
lines changed Original file line number Diff line number Diff line change 1+ //golangcitest:args -Evarnamelen
2+ //golangcitest:config_path testdata/varnamelen_configuration.yml
3+ //golangcitest:expected_exitcode 0
4+ package testdata
5+
6+ import "fmt"
7+
8+ func _ () {
9+ ok := foo ()
10+
11+ fmt .Println ("a" )
12+ fmt .Println ("b" )
13+ fmt .Println ("c" )
14+ fmt .Println ("d" )
15+ println (ok )
16+ }
17+
18+ func _ () {
19+ fn := foo ()
20+
21+ fmt .Println ("a" )
22+ fmt .Println ("b" )
23+ fmt .Println ("c" )
24+ fmt .Println ("d" )
25+ println (fn )
26+ }
27+
28+ func foo () bool {
29+ return true
30+ }
Original file line number Diff line number Diff line change 1+ version : " 2"
2+
3+ linters :
4+ settings :
5+ varnamelen :
6+ ignore-names :
7+ - fn
8+ ignore-decls :
9+ - ok bool
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ func New(settings *config.VarnamelenSettings) *goanalysis.Linter {
1414 var cfg map [string ]any
1515
1616 if settings != nil {
17- vnlCfg : = map [string ]any {
17+ cfg = map [string ]any {
1818 "checkReceiver" : strconv .FormatBool (settings .CheckReceiver ),
1919 "checkReturn" : strconv .FormatBool (settings .CheckReturn ),
2020 "checkTypeParam" : strconv .FormatBool (settings .CheckTypeParam ),
@@ -26,11 +26,11 @@ func New(settings *config.VarnamelenSettings) *goanalysis.Linter {
2626 }
2727
2828 if settings .MaxDistance > 0 {
29- vnlCfg ["maxDistance" ] = strconv .Itoa (settings .MaxDistance )
29+ cfg ["maxDistance" ] = strconv .Itoa (settings .MaxDistance )
3030 }
3131
3232 if settings .MinNameLength > 0 {
33- vnlCfg ["minNameLength" ] = strconv .Itoa (settings .MinNameLength )
33+ cfg ["minNameLength" ] = strconv .Itoa (settings .MinNameLength )
3434 }
3535 }
3636
You can’t perform that action at this time.
0 commit comments