From 4273ebc50d9cf8fa6a4b15ccdbcbc5de782343a9 Mon Sep 17 00:00:00 2001 From: Zlatko Bratkovic Date: Mon, 19 Aug 2024 13:57:00 +0200 Subject: [PATCH] CLEANUP/MINOR: aspell: clarify what ignore means --- .aspell.yml | 4 ++-- README.md | 2 +- aspell/aspell.go | 4 ++-- aspell/new.go | 7 ++----- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.aspell.yml b/.aspell.yml index 1ce77de..b9d4240 100644 --- a/.aspell.yml +++ b/.aspell.yml @@ -1,7 +1,7 @@ mode: all min_length: 3 -ignore: - - '*_test.go' +ignore_files: + - '*test.go' allowed: - aspell - repo diff --git a/README.md b/README.md index ea90caa..ca14e6f 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ example ```yaml mode: subject min_length: 3 -ignore: +ignore_files: - go.mod - go.sum - '*test.go' diff --git a/aspell/aspell.go b/aspell/aspell.go index 47cb205..05bb6bf 100644 --- a/aspell/aspell.go +++ b/aspell/aspell.go @@ -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:"-"` } @@ -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 diff --git a/aspell/new.go b/aspell/new.go index b8a78f0..64f6e5c 100644 --- a/aspell/new.go +++ b/aspell/new.go @@ -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 @@ -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) } }