Skip to content

Commit 8c7e1ea

Browse files
committed
Print instructions for false positive resolution when spell check fails
The assets include infrastructure to check for commonly misspelled words in the project files. Although the system is designed to reduce the incidence of false positives, they are still relatively common. For this reason, it is important to clearly communicate to the contributor how such false positives can be resolved. This can be accomplished effectively by printing instructions when the spell check fails. In order to avoid excessive verbosity of the output (note that the failure could just as well be a true positive), the description of the procedure is maintained in the asset documentation and the output message simply provides the URL of that documentation.
1 parent e339c15 commit 8c7e1ea

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

Taskfile.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,16 @@ tasks:
599599
vars:
600600
POETRY_GROUPS: dev
601601
cmds:
602-
- poetry run codespell
602+
- |
603+
if
604+
! poetry run \
605+
codespell
606+
then
607+
echo
608+
echo "If this was a false positive, add the word to the ignore list. See:"
609+
echo "https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/spell-check-task.md#false-positives"
610+
exit 1
611+
fi
603612
604613
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-files-task/Taskfile.yml
605614
general:check-symlinks:

workflow-templates/assets/spell-check-task/Taskfile.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,16 @@ tasks:
1010
vars:
1111
POETRY_GROUPS: dev
1212
cmds:
13-
- poetry run codespell
13+
- |
14+
if
15+
! poetry run \
16+
codespell
17+
then
18+
echo
19+
echo "If this was a false positive, add the word to the ignore list:"
20+
echo "https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/spell-check-task.md#false-positives"
21+
exit 1
22+
fi
1423
1524
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/spell-check-task/Taskfile.yml
1625
general:correct-spelling:

workflow-templates/spell-check-task.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ Commit the resulting changes to the `pyproject.toml` and `poetry.lock` files.
4545

4646
If the repository contains generated or vendored files, they can be excluded from the check by adding them to the `skip` field in the `.codespellrc` configuration file.
4747

48+
#### False positives
49+
4850
In the event of a false positive, the problematic word should be added, in all lowercase, to the `ignore-words-list` field of `./.codespellrc`. Regardless of the case of the word in the false positive, it must be in all lowercase in the ignore list. The ignore list is comma-separated with no spaces.
4951

5052
Reference:

0 commit comments

Comments
 (0)