diff --git a/.aspell.yml b/.aspell.yml index 9ff2d38..c9113aa 100644 --- a/.aspell.yml +++ b/.aspell.yml @@ -5,21 +5,13 @@ ignore: allowed: - aspell - repo - - yaml - - config - - Github - - Gitlab - - env - failsafe - golang - mkdir - - WORKDIR - apk - - ENTRYPOINT - ubuntu - golangci - splitted - - sudo - mri - IID - repo @@ -32,9 +24,6 @@ allowed: - MINSUBJECTPARTS - malformatted - cmdline - - Dockerfile - - ghcr - sed - - stdin - runnumber - args diff --git a/aspell/aspell.go b/aspell/aspell.go index fc24154..2404463 100644 --- a/aspell/aspell.go +++ b/aspell/aspell.go @@ -23,14 +23,27 @@ type Aspell struct { } var ( - camelCaseOK = map[string]struct{}{ - "HAProxy": {}, + acceptableWordsGlobal = map[string]struct{}{ + "haproxy": {}, "golang": {}, "ascii": {}, "api": {}, "goreleaser": {}, + "github": {}, + "gitlab": {}, + "yaml": {}, + "env": {}, + "config": {}, + "workdir": {}, + "entrypoint": {}, + "sudo": {}, + "dockerfile": {}, + "ghcr": {}, + "sed": {}, + "stdin": {}, + "args": {}, } - camelCaseNotOK = map[string]struct{}{} + badWordsGlobal = map[string]struct{}{} ) func (a Aspell) checkSingle(data string, allowedWords []string) error { @@ -50,11 +63,11 @@ func (a Aspell) checkSingle(data string, allowedWords []string) error { if len(word) < a.MinLength { continue } - if _, ok := camelCaseNotOK[wordLower]; ok { + if _, ok := badWordsGlobal[wordLower]; ok { badWords = append(badWords, wordLower) continue } - if _, ok := camelCaseOK[wordLower]; ok { + if _, ok := acceptableWordsGlobal[wordLower]; ok { continue } if slices.Contains(a.AllowedWords, wordLower) || slices.Contains(allowedWords, wordLower) { @@ -70,13 +83,13 @@ func (a Aspell) checkSingle(data string, allowedWords []string) error { for _, s := range splitted { er := a.checkSingle(s, allowedWords) if er != nil { - camelCaseNotOK[wordLower] = struct{}{} + badWordsGlobal[wordLower] = struct{}{} badWords = append(badWords, word+":"+s) break } } } else { - camelCaseNotOK[wordLower] = struct{}{} + badWordsGlobal[wordLower] = struct{}{} badWords = append(badWords, word) } }