Skip to content

Commit 498aa85

Browse files
authored
Merge pull request #226 from per1234/spell-check
Sync "Spell Check" CI workflow with template
2 parents ac5c2db + 9aba617 commit 498aa85

8 files changed

+63
-50
lines changed

.codespellrc

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

.github/workflows/spell-check.yml

-33
This file was deleted.

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
[![Publish Nightly Build status](https://github.com/arduino/arduino-lint/actions/workflows/publish-go-nightly-task.yml/badge.svg)](https://github.com/arduino/arduino-lint/actions/workflows/publish-go-nightly-task.yml)
99
[![Check Python status](https://github.com/arduino/arduino-lint/actions/workflows/check-python-task.yml/badge.svg)](https://github.com/arduino/arduino-lint/actions/workflows/check-python-task.yml)
1010
[![Check Markdown status](https://github.com/arduino/arduino-lint/actions/workflows/check-markdown-task.yml/badge.svg)](https://github.com/arduino/arduino-lint/actions/workflows/check-markdown-task.yml)
11+
[![Spell Check status](https://github.com/arduino/arduino-lint/actions/workflows/spell-check-task.yml/badge.svg)](https://github.com/arduino/arduino-lint/actions/workflows/spell-check-task.yml)
1112
[![Check Website status](https://github.com/arduino/arduino-lint/actions/workflows/check-mkdocs-task.yml/badge.svg)](https://github.com/arduino/arduino-lint/actions/workflows/check-mkdocs-task.yml)
1213
[![Deploy Website status](https://github.com/arduino/arduino-lint/actions/workflows/deploy-cobra-mkdocs-versioned-poetry.yml/badge.svg)](https://github.com/arduino/arduino-lint/actions/workflows/deploy-cobra-mkdocs-versioned-poetry.yml)
1314
[![Codecov](https://codecov.io/gh/arduino/arduino-lint/branch/main/graph/badge.svg?token=nprqPQMbdh)](https://codecov.io/gh/arduino/arduino-lint)

Taskfile.yml

+11-10
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ vars:
3434

3535
PRETTIER: prettier@2.1.2
3636

37-
CODESPELL_SKIP_OPTION: '--skip "./.git,go.mod,go.sum,./arduino-lint,./arduino-lint.exe,./internal/rule/rulefunction/testdata/libraries/MisspelledSentenceParagraphValue/library.properties,./site"'
38-
CODESPELL_IGNORE_WORDS_OPTION: "--ignore-words ./etc/codespell-ignore-words-list.txt"
39-
4037
tasks:
4138
build:
4239
desc: Build the project
@@ -95,7 +92,7 @@ tasks:
9592
- task: docs:check
9693
- task: config:check
9794
- task: general:check-formatting
98-
- task: check-spelling
95+
- task: general:check-spelling
9996
- task: shell:check-mode
10097

10198
lint:
@@ -405,14 +402,18 @@ tasks:
405402
cmds:
406403
- npx prettier --write .
407404

408-
check-spelling:
405+
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/spell-check-task/Taskfile.yml
406+
general:check-spelling:
409407
desc: Check for commonly misspelled words
408+
deps:
409+
- task: poetry:install-deps
410410
cmds:
411-
- poetry install --no-root
412-
- poetry run codespell {{.CODESPELL_SKIP_OPTION}} {{.CODESPELL_IGNORE_WORDS_OPTION}}
411+
- poetry run codespell
413412

414-
correct-spelling:
413+
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/spell-check-task/Taskfile.yml
414+
general:correct-spelling:
415415
desc: Correct commonly misspelled words where possible
416+
deps:
417+
- task: poetry:install-deps
416418
cmds:
417-
- poetry install --no-root
418-
- poetry run codespell --write-changes {{.CODESPELL_SKIP_OPTION}} {{.CODESPELL_IGNORE_WORDS_OPTION}}
419+
- poetry run codespell --write-changes

etc/codespell-ignore-words-list.txt

-2
This file was deleted.

poetry.lock

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

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ mkdocs-material = "^7.1.8"
2323

2424
[tool.poetry.dev-dependencies]
2525
black = "^21.7b0"
26-
codespell = ">=1.17.1"
26+
codespell = "^2.1.0"
2727
flake8 = "^3.9.2"
2828
pep8-naming = "^0.12.0"
2929

0 commit comments

Comments
 (0)