@@ -10,42 +10,42 @@ import (
10
10
"github.com/golangci/golangci-lint/pkg/goanalysis"
11
11
)
12
12
13
- func New (cfg * config.BiDiChkSettings ) * goanalysis.Linter {
13
+ func New (settings * config.BiDiChkSettings ) * goanalysis.Linter {
14
14
a := bidichk .NewAnalyzer ()
15
15
16
- cfgMap := map [string ]map [string ]any {}
17
- if cfg != nil {
16
+ cfg := map [string ]map [string ]any {}
17
+ if settings != nil {
18
18
var opts []string
19
19
20
- if cfg .LeftToRightEmbedding {
20
+ if settings .LeftToRightEmbedding {
21
21
opts = append (opts , "LEFT-TO-RIGHT-EMBEDDING" )
22
22
}
23
- if cfg .RightToLeftEmbedding {
23
+ if settings .RightToLeftEmbedding {
24
24
opts = append (opts , "RIGHT-TO-LEFT-EMBEDDING" )
25
25
}
26
- if cfg .PopDirectionalFormatting {
26
+ if settings .PopDirectionalFormatting {
27
27
opts = append (opts , "POP-DIRECTIONAL-FORMATTING" )
28
28
}
29
- if cfg .LeftToRightOverride {
29
+ if settings .LeftToRightOverride {
30
30
opts = append (opts , "LEFT-TO-RIGHT-OVERRIDE" )
31
31
}
32
- if cfg .RightToLeftOverride {
32
+ if settings .RightToLeftOverride {
33
33
opts = append (opts , "RIGHT-TO-LEFT-OVERRIDE" )
34
34
}
35
- if cfg .LeftToRightIsolate {
35
+ if settings .LeftToRightIsolate {
36
36
opts = append (opts , "LEFT-TO-RIGHT-ISOLATE" )
37
37
}
38
- if cfg .RightToLeftIsolate {
38
+ if settings .RightToLeftIsolate {
39
39
opts = append (opts , "RIGHT-TO-LEFT-ISOLATE" )
40
40
}
41
- if cfg .FirstStrongIsolate {
41
+ if settings .FirstStrongIsolate {
42
42
opts = append (opts , "FIRST-STRONG-ISOLATE" )
43
43
}
44
- if cfg .PopDirectionalIsolate {
44
+ if settings .PopDirectionalIsolate {
45
45
opts = append (opts , "POP-DIRECTIONAL-ISOLATE" )
46
46
}
47
47
48
- cfgMap [a .Name ] = map [string ]any {
48
+ cfg [a .Name ] = map [string ]any {
49
49
"disallowed-runes" : strings .Join (opts , "," ),
50
50
}
51
51
}
@@ -54,6 +54,6 @@ func New(cfg *config.BiDiChkSettings) *goanalysis.Linter {
54
54
a .Name ,
55
55
"Checks for dangerous unicode character sequences" ,
56
56
[]* analysis.Analyzer {a },
57
- cfgMap ,
57
+ cfg ,
58
58
).WithLoadMode (goanalysis .LoadModeSyntax )
59
59
}
0 commit comments