Skip to content

Commit 57466a6

Browse files
committed
MINOR: add more words to globally accepted list
1 parent 92e4f25 commit 57466a6

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

.aspell.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,13 @@ ignore:
55
allowed:
66
- aspell
77
- repo
8-
- yaml
9-
- config
10-
- Github
11-
- Gitlab
12-
- env
138
- failsafe
149
- golang
1510
- mkdir
16-
- WORKDIR
1711
- apk
18-
- ENTRYPOINT
1912
- ubuntu
2013
- golangci
2114
- splitted
22-
- sudo
2315
- mri
2416
- IID
2517
- repo
@@ -32,9 +24,6 @@ allowed:
3224
- MINSUBJECTPARTS
3325
- malformatted
3426
- cmdline
35-
- Dockerfile
36-
- ghcr
3727
- sed
38-
- stdin
3928
- runnumber
4029
- args

aspell/aspell.go

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,27 @@ type Aspell struct {
2323
}
2424

2525
var (
26-
camelCaseOK = map[string]struct{}{
27-
"HAProxy": {},
26+
acceptableWordsGlobal = map[string]struct{}{
27+
"haproxy": {},
2828
"golang": {},
2929
"ascii": {},
3030
"api": {},
3131
"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": {},
3245
}
33-
camelCaseNotOK = map[string]struct{}{}
46+
badWordsGlobal = map[string]struct{}{}
3447
)
3548

3649
func (a Aspell) checkSingle(data string, allowedWords []string) error {
@@ -50,11 +63,11 @@ func (a Aspell) checkSingle(data string, allowedWords []string) error {
5063
if len(word) < a.MinLength {
5164
continue
5265
}
53-
if _, ok := camelCaseNotOK[wordLower]; ok {
66+
if _, ok := badWordsGlobal[wordLower]; ok {
5467
badWords = append(badWords, wordLower)
5568
continue
5669
}
57-
if _, ok := camelCaseOK[wordLower]; ok {
70+
if _, ok := acceptableWordsGlobal[wordLower]; ok {
5871
continue
5972
}
6073
if slices.Contains(a.AllowedWords, wordLower) || slices.Contains(allowedWords, wordLower) {
@@ -70,13 +83,13 @@ func (a Aspell) checkSingle(data string, allowedWords []string) error {
7083
for _, s := range splitted {
7184
er := a.checkSingle(s, allowedWords)
7285
if er != nil {
73-
camelCaseNotOK[wordLower] = struct{}{}
86+
badWordsGlobal[wordLower] = struct{}{}
7487
badWords = append(badWords, word+":"+s)
7588
break
7689
}
7790
}
7891
} else {
79-
camelCaseNotOK[wordLower] = struct{}{}
92+
badWordsGlobal[wordLower] = struct{}{}
8093
badWords = append(badWords, word)
8194
}
8295
}

0 commit comments

Comments
 (0)