Skip to content

Commit 9b54ca5

Browse files
committed
Add CI workflow to check for commonly misspelled words
On every push, pull request, and periodically, use the codespell-project/actions-codespell action to check for commonly misspelled words. 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.
1 parent c65074e commit 9b54ca5

File tree

6 files changed

+90
-0
lines changed

6 files changed

+90
-0
lines changed

.codespellrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# See: https://github.com/codespell-project/codespell#using-a-config-file
2+
[codespell]
3+
# In the event of a false positive, add the problematic word, in all lowercase, to a comma-separated list here:
4+
ignore-words-list = afterall
5+
builtin = clear,informal,en-GB_to_en-US
6+
check-filenames =
7+
check-hidden =
8+
skip = ./.git,./dist,./package-lock.json,./poetry.lock
+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Spell Check
2+
3+
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
4+
on:
5+
push:
6+
pull_request:
7+
schedule:
8+
# Run every Tuesday at 8 AM UTC to catch new misspelling detections resulting from dictionary updates.
9+
- cron: "0 8 * * TUE"
10+
workflow_dispatch:
11+
repository_dispatch:
12+
13+
jobs:
14+
spellcheck:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v2
20+
21+
- name: Install Python
22+
uses: actions/setup-python@v2
23+
with:
24+
python-version: "3.9"
25+
26+
- name: Install Poetry
27+
run: pip install poetry
28+
29+
- name: Install Task
30+
uses: arduino/actions/setup-taskfile@master
31+
with:
32+
repo-token: ${{ secrets.GITHUB_TOKEN }}
33+
version: 3.x
34+
35+
- name: Spell check
36+
run: task general:check-spelling

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[![Integration Tests status](https://github.com/arduino/setup-taskfile/actions/workflows/test-integration.yml/badge.svg)](https://github.com/arduino/setup-taskfile/actions/workflows/test-integration.yml)
44
[![Check Action Metadata status](https://github.com/arduino/setup-taskfile/actions/workflows/check-action-metadata-task.yml/badge.svg)](https://github.com/arduino/setup-taskfile/actions/workflows/check-action-metadata-task.yml)
5+
[![Spell Check status](https://github.com/arduino/setup-taskfile/actions/workflows/spell-check.yml/badge.svg)](https://github.com/arduino/setup-taskfile/actions/workflows/spell-check.yml)
56
[![Check License status](https://github.com/arduino/setup-taskfile/actions/workflows/check-license.yml/badge.svg)](https://github.com/arduino/setup-taskfile/actions/workflows/check-license.yml)
67

78
This action makes the `task` binary available to Workflows.

Taskfile.yml

+12
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,15 @@ tasks:
1414
cmds:
1515
- wget --output-document={{ .ACTION_METADATA_SCHEMA_PATH }} https://json.schemastore.org/github-action
1616
- npx ajv-cli validate --strict=false -s {{ .ACTION_METADATA_SCHEMA_PATH }} -d "action.yml"
17+
18+
general:check-spelling:
19+
desc: Check for commonly misspelled words
20+
cmds:
21+
- poetry install --no-root
22+
- poetry run codespell
23+
24+
general:correct-spelling:
25+
desc: Correct commonly misspelled words where possible
26+
cmds:
27+
- poetry install --no-root
28+
- poetry run codespell --write-changes

poetry.lock

+22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[tool.poetry]
2+
name = "setup-taskfile"
3+
version = "0.0.0"
4+
description = "GitHub Actions action to install Task"
5+
authors = ["Arduino <[email protected]>"]
6+
7+
[tool.poetry.dependencies]
8+
python = "^3.9"
9+
10+
[tool.poetry.dev-dependencies]
11+
codespell = ">=2.0.0"

0 commit comments

Comments
 (0)