-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate to Task-based spell check system
A task is added to check for commonly misspelled words in the project files. On every push and pull request that affects relevant files, this task will be executed by the GitHub Actions workflow. The updated system makes it easy for contributors to run the same checking operation locally as will be done by the CI system, using the Task task runner tool.
- Loading branch information
Showing
7 changed files
with
135 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/spell-check/.codespellrc | ||
# See: https://github.com/codespell-project/codespell#using-a-config-file | ||
[codespell] | ||
# In the event of a false positive, add the problematic word, in all lowercase, to a comma-separated list here: | ||
ignore-words-list = ameba | ||
skip = ./.git,./.licenses,__pycache__,node_modules,./go.mod,./go.sum,./package-lock.json,./poetry.lock,./yarn.lock | ||
builtin = clear,informal,en-GB_to_en-US | ||
check-filenames = | ||
check-hidden = | ||
skip = ./.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/spell-check-task.md | ||
name: Spell Check | ||
|
||
# See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows | ||
on: | ||
create: | ||
push: | ||
pull_request: | ||
schedule: | ||
# Run every Tuesday at 8 AM UTC to catch new misspelling detections resulting from dictionary updates. | ||
- cron: "0 8 * * TUE" | ||
workflow_dispatch: | ||
repository_dispatch: | ||
|
||
jobs: | ||
run-determination: | ||
runs-on: ubuntu-latest | ||
permissions: {} | ||
outputs: | ||
result: ${{ steps.determination.outputs.result }} | ||
steps: | ||
- name: Determine if the rest of the workflow should run | ||
id: determination | ||
run: | | ||
RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" | ||
# The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. | ||
if [[ | ||
"${{ github.event_name }}" != "create" || | ||
"${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX | ||
]]; then | ||
# Run the other jobs. | ||
RESULT="true" | ||
else | ||
# There is no need to run the other jobs. | ||
RESULT="false" | ||
fi | ||
echo "result=$RESULT" >> $GITHUB_OUTPUT | ||
spellcheck: | ||
needs: run-determination | ||
if: needs.run-determination.outputs.result == 'true' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version-file: pyproject.toml | ||
|
||
- name: Install Poetry | ||
run: | | ||
pipx install \ | ||
--python "$(which python)" \ | ||
poetry | ||
- name: Install Task | ||
uses: arduino/setup-task@v1 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
version: 3.x | ||
|
||
- name: Spell check | ||
run: task general:check-spelling |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[tool.poetry] | ||
name = "inoplatforms" | ||
version = "0.0.0" | ||
description = "" | ||
authors = ["per1234 <[email protected]>"] | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.12" | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
codespell = "2.2.5" | ||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" |