@@ -23,14 +23,27 @@ type Aspell struct {
23
23
}
24
24
25
25
var (
26
- camelCaseOK = map [string ]struct {}{
27
- "HAProxy " : {},
26
+ acceptableWordsGlobal = map [string ]struct {}{
27
+ "haproxy " : {},
28
28
"golang" : {},
29
29
"ascii" : {},
30
30
"api" : {},
31
31
"goreleaser" : {},
32
+ "github" : {},
33
+ "gitlab" : {},
34
+ "yaml" : {},
35
+ "env" : {},
36
+ "config" : {},
37
+ "workdir" : {},
38
+ "entrypoint" : {},
39
+ "sudo" : {},
40
+ "dockerfile" : {},
41
+ "ghcr" : {},
42
+ "sed" : {},
43
+ "stdin" : {},
44
+ "args" : {},
32
45
}
33
- camelCaseNotOK = map [string ]struct {}{}
46
+ badWordsGlobal = map [string ]struct {}{}
34
47
)
35
48
36
49
func (a Aspell ) checkSingle (data string , allowedWords []string ) error {
@@ -50,11 +63,11 @@ func (a Aspell) checkSingle(data string, allowedWords []string) error {
50
63
if len (word ) < a .MinLength {
51
64
continue
52
65
}
53
- if _ , ok := camelCaseNotOK [wordLower ]; ok {
66
+ if _ , ok := badWordsGlobal [wordLower ]; ok {
54
67
badWords = append (badWords , wordLower )
55
68
continue
56
69
}
57
- if _ , ok := camelCaseOK [wordLower ]; ok {
70
+ if _ , ok := acceptableWordsGlobal [wordLower ]; ok {
58
71
continue
59
72
}
60
73
if slices .Contains (a .AllowedWords , wordLower ) || slices .Contains (allowedWords , wordLower ) {
@@ -70,13 +83,13 @@ func (a Aspell) checkSingle(data string, allowedWords []string) error {
70
83
for _ , s := range splitted {
71
84
er := a .checkSingle (s , allowedWords )
72
85
if er != nil {
73
- camelCaseNotOK [wordLower ] = struct {}{}
86
+ badWordsGlobal [wordLower ] = struct {}{}
74
87
badWords = append (badWords , word + ":" + s )
75
88
break
76
89
}
77
90
}
78
91
} else {
79
- camelCaseNotOK [wordLower ] = struct {}{}
92
+ badWordsGlobal [wordLower ] = struct {}{}
80
93
badWords = append (badWords , word )
81
94
}
82
95
}
0 commit comments