Skip to content

Commit 1686331

Browse files
committed
CLEANUP/MINOR: include commit subject in spell check error logs
Previously, when a spell check failed on a commit message, the log output only printed "commit message" or "commit message body" along with the error. This made it difficult to identify which specific commit failed the check when processing multiple commits. This change extracts the commit subject and includes it in the log output, providing clear context and traceability for debugging spell check failures.
1 parent 5be1bc8 commit 1686331

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

aspell/aspell.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,15 +227,16 @@ func (a Aspell) checkFiles(content []map[string]string, identifierWords []string
227227
func (a Aspell) checkCommitMessages(commitsFullData []string, identifierWords []string, junitSuite junit.Interface, response *strings.Builder) {
228228
for _, msg := range commitsFullData {
229229
parts := strings.SplitN(msg, "\n\n", 2)
230-
if err := a.checkSingle(parts[0], []string{}); err != nil {
230+
subject := parts[0]
231+
if err := a.checkSingle(subject, []string{}); err != nil {
231232
junitSuite.AddMessageFailed("commit message", "aspell check failed", err.Error())
232-
log.Println("commit message", err.Error())
233+
log.Printf("commit %q subject %s", subject, err.Error())
233234
_, _ = fmt.Fprintf(response, "%s\n", err)
234235
}
235236
if len(parts) > 1 {
236237
if err := a.checkSingle(parts[1], identifierWords); err != nil {
237238
junitSuite.AddMessageFailed("commit message", "aspell check failed", err.Error())
238-
log.Println("commit message body", err.Error())
239+
log.Printf("commit %q body %s", subject, err.Error())
239240
_, _ = fmt.Fprintf(response, "%s\n", err)
240241
}
241242
}

aspell/dictionaries/computing.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ addon
77
addons
88
algo
99
alloc
10+
amd
1011
aspell
1112
async
1213
autoconf

0 commit comments

Comments
 (0)