Skip to content

Commit a567bc1

Browse files
committed
MINOR: log what words are considered to be misspelled
1 parent 40c36c9 commit a567bc1

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

aspell/aspell.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,14 @@ func (a Aspell) Check(subjects []string, commitsFull []string, content []map[str
129129
}
130130
}
131131
}
132-
checks = []string{}
132+
checks = commitsFull
133133
default:
134134
checks = subjects
135135
}
136136

137137
for _, subject := range checks {
138138
if err := a.checkSingle(subject, []string{}); err != nil {
139+
log.Println("commit message", err.Error())
139140
response += fmt.Sprintf("%s\n", err)
140141
}
141142
}

aspell/new.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ import (
1212
func New(filename string) (Aspell, error) {
1313
var data []byte
1414
var err error
15+
fileExists := true
1516
if data, err = os.ReadFile(filename); err != nil {
1617
log.Printf("warning: aspell exceptions file not found (%s)", err)
18+
fileExists = false
1719
}
1820

1921
var aspell Aspell
@@ -42,7 +44,11 @@ func New(filename string) (Aspell, error) {
4244
}
4345

4446
log.Printf("aspell mode set to %s", aspell.Mode)
45-
aspell.HelpText = `aspell can be configured with .aspell.yml file.
47+
if fileExists {
48+
aspell.HelpText = `aspell can be configured with .aspell.yml file.
49+
Add words to allowed list if its false positive`
50+
} else {
51+
aspell.HelpText = `aspell can be configured with .aspell.yml file.
4652
content example:
4753
mode: subject
4854
min_length: 3
@@ -55,6 +61,7 @@ allowed:
5561
- aspell
5662
- config
5763
`
64+
}
5865

5966
ignoreFiles := []string{"go.mod", "go.sum"}
6067
for _, file := range ignoreFiles {

0 commit comments

Comments
 (0)