|
| 1 | +# "Spell Check" workflow (Task) |
| 2 | + |
| 3 | +Workflow file: [spell-check-task.yml](spell-check-task.yml) |
| 4 | + |
| 5 | +Use [codespell](https://github.com/codespell-project/codespell) to check for commonly misspelled words in the repository files. |
| 6 | + |
| 7 | +This is the version of the workflow for projects using the [Task](https://taskfile.dev/#/) task runner tool. |
| 8 | + |
| 9 | +## Installation |
| 10 | + |
| 11 | +The `codespell` tool dependency is managed by [Poetry](https://python-poetry.org/). |
| 12 | + |
| 13 | +Install Poetry by following these instructions:<br /> |
| 14 | +https://python-poetry.org/docs/#installation |
| 15 | + |
| 16 | +If your project does not already use Poetry, you can initialize the [`pyproject.toml`](https://python-poetry.org/docs/pyproject/) file using these commands: |
| 17 | + |
| 18 | +``` |
| 19 | +poetry init --python="^3.9" --dev-dependency="codespell@^2.1.0" |
| 20 | +poetry install |
| 21 | +``` |
| 22 | + |
| 23 | +If already using Poetry, add the tool using this command: |
| 24 | + |
| 25 | +``` |
| 26 | +poetry add --dev "codespell@^2.1.0" |
| 27 | +``` |
| 28 | + |
| 29 | +Make sure to commit the resulting `pyproject.toml` and `poetry.lock` files. |
| 30 | + |
| 31 | +## Assets |
| 32 | + |
| 33 | +- [.codespellrc](assets/spell-check/.codespellrc) - codespell configuration file. |
| 34 | + - Install to: repository root |
| 35 | +- [`Taskfile.yml`](assets/spell-check-task/Taskfile.yml] - spell check and spelling correction tasks. |
| 36 | + - Install to: repository root (or add the `general:general:check-spelling` and `general:correct-spelling` tasks into the existing `Taskfile.yml`) |
| 37 | +- [`Taskfile.yml`](assets/shared/Taskfile.yml] - Installation task. |
| 38 | + - Add the `poetry:install-deps` task into the existing `Taskfile.yml` |
| 39 | + |
| 40 | +## Readme badge |
| 41 | + |
| 42 | +Markdown badge: |
| 43 | + |
| 44 | +```markdown |
| 45 | +[](https://github.com/REPO_OWNER/REPO_NAME/actions/workflows/spell-check-task.yml) |
| 46 | +``` |
| 47 | + |
| 48 | +Replace the `REPO_OWNER` and `REPO_NAME` placeholders in the URLs with the final repository owner and name ([example](https://raw.githubusercontent.com/arduino-libraries/ArduinoIoTCloud/master/README.md)). |
| 49 | + |
| 50 | +--- |
| 51 | + |
| 52 | +Asciidoc badge: |
| 53 | + |
| 54 | +```adoc |
| 55 | +image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/spell-check-task.yml/badge.svg["Spell Check status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/spell-check-task.yml"] |
| 56 | +``` |
| 57 | + |
| 58 | +Define the `{repository-owner}` and `{repository-name}` attributes and use them throughout the readme ([example](https://raw.githubusercontent.com/arduino-libraries/WiFiNINA/master/README.adoc)). |
| 59 | + |
| 60 | +## Commit message |
| 61 | + |
| 62 | +``` |
| 63 | +Add CI workflow to check for commonly misspelled words |
| 64 | + |
| 65 | +On every push, pull request, and periodically, use the codespell to check for commonly |
| 66 | +misspelled words. |
| 67 | + |
| 68 | +In the event of a false positive, the problematic word should be added, in all lowercase, to the ignore-words-list field |
| 69 | +of ./.codespellrc. Regardless of the case of the word in the false positive, it must be in all lowercase in the ignore |
| 70 | +list. The ignore list is comma-separated with no spaces. |
| 71 | +``` |
| 72 | +
|
| 73 | +## PR message |
| 74 | +
|
| 75 | +```markdown |
| 76 | +On every push, pull request, and periodically, use [codespell](https://github.com/codespell-project/codespell) to check for commonly misspelled words. |
| 77 | +
|
| 78 | +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. |
| 79 | +``` |
0 commit comments