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 {
14
14
var cfg map [string ]any
15
15
16
16
if settings != nil {
17
- vnlCfg : = map [string ]any {
17
+ cfg = map [string ]any {
18
18
"checkReceiver" : strconv .FormatBool (settings .CheckReceiver ),
19
19
"checkReturn" : strconv .FormatBool (settings .CheckReturn ),
20
20
"checkTypeParam" : strconv .FormatBool (settings .CheckTypeParam ),
@@ -26,11 +26,11 @@ func New(settings *config.VarnamelenSettings) *goanalysis.Linter {
26
26
}
27
27
28
28
if settings .MaxDistance > 0 {
29
- vnlCfg ["maxDistance" ] = strconv .Itoa (settings .MaxDistance )
29
+ cfg ["maxDistance" ] = strconv .Itoa (settings .MaxDistance )
30
30
}
31
31
32
32
if settings .MinNameLength > 0 {
33
- vnlCfg ["minNameLength" ] = strconv .Itoa (settings .MinNameLength )
33
+ cfg ["minNameLength" ] = strconv .Itoa (settings .MinNameLength )
34
34
}
35
35
}
36
36
You can’t perform that action at this time.
0 commit comments