Skip to content

Commit

Permalink
CLEANUP/MINOR: aspell: clarify what ignore means
Browse files Browse the repository at this point in the history
  • Loading branch information
oktalz committed Aug 19, 2024
1 parent 8684402 commit 4273ebc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .aspell.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
mode: all
min_length: 3
ignore:
- '*_test.go'
ignore_files:
- '*test.go'
allowed:
- aspell
- repo
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ example
```yaml
mode: subject
min_length: 3
ignore:
ignore_files:
- go.mod
- go.sum
- '*test.go'
Expand Down
4 changes: 2 additions & 2 deletions aspell/aspell.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
type Aspell struct {
Mode mode `yaml:"mode"`
MinLength int `yaml:"min_length"`
Ignore []string `yaml:"ignore"`
IgnoreFiles []string `yaml:"ignore_files"`
AllowedWords []string `yaml:"allowed"`
HelpText string `yaml:"-"`
}
Expand Down Expand Up @@ -126,7 +126,7 @@ func (a Aspell) Check(subjects []string, commitsFull []string, content []map[str
for _, file := range content {
for name, v := range file {
nextFile := false
for _, filter := range a.Ignore {
for _, filter := range a.IgnoreFiles {
if match.MatchFilter(name, filter) {
// log.Println("File", name, "in ignore list")
nextFile = true
Expand Down
7 changes: 2 additions & 5 deletions aspell/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ Add words to allowed list if its false positive`
content example:
mode: subject
min_length: 3
ignore:
- go.mod
- go.sum
- '*test.go'
ignore_files:
- 'gen/*'
allowed:
- aspell
Expand All @@ -67,7 +64,7 @@ allowed:
for _, file := range ignoreFiles {
if _, err := os.Stat(file); err == nil {
log.Printf("aspell: added %s to ignore list", file)
aspell.Ignore = append(aspell.Ignore, file)
aspell.IgnoreFiles = append(aspell.IgnoreFiles, file)
}
}

Expand Down

0 comments on commit 4273ebc

Please sign in to comment.