Skip to content
This repository was archived by the owner on Apr 1, 2022. It is now read-only.

Deprecate arduino/actions/libraries/spell-check action #101

Merged
merged 2 commits into from
Apr 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +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 = afterall,clude
skip = ./.git,./.licenses,__pycache__,node_modules,./go.mod,./go.sum,./package-lock.json,./poetry.lock,./yarn.lock,./libraries/spell-check/test/testdata,./setup-taskfile/package-lock.json
builtin = clear,informal,en-GB_to_en-US
check-filenames =
check-hidden =
41 changes: 41 additions & 0 deletions .github/workflows/spell-check-task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/spell-check-task.md
name: Spell Check

env:
# See: https://github.com/actions/setup-python/tree/v2#available-versions-of-python
PYTHON_VERSION: "3.9"

# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
on:
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:
spellcheck:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install Python
uses: actions/setup-python@v3
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install Poetry
run: pip install 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
17 changes: 0 additions & 17 deletions .github/workflows/spell-check.yml

This file was deleted.

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ action in a Google Sheets spreadsheet.

* [libraries/spell-check](./libraries/spell-check) checks the files of your
repository for commonly misspelled words.
* **WARNING**: The `arduino/actions/libraries/spell-check` action
contained in this repository is deprecated. The recommended alternative is
[the `codespell-project/actions-codespell` action](https://github.com/codespell-project/actions-codespell).


* [arduino/setup-task](https://github.com/arduino/setup-task) makes [Task](https://taskfile.dev/#/)
available to your workflows.
Expand Down
25 changes: 25 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# See: https://taskfile.dev/#/usage
version: "3"

tasks:
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/spell-check-task/Taskfile.yml
general:check-spelling:
desc: Check for commonly misspelled words
deps:
- task: poetry:install-deps
cmds:
- poetry run codespell

# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/spell-check-task/Taskfile.yml
general:correct-spelling:
desc: Correct commonly misspelled words where possible
deps:
- task: poetry:install-deps
cmds:
- poetry run codespell --write-changes

# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/poetry-task/Taskfile.yml
poetry:install-deps:
desc: Install dependencies managed by Poetry
cmds:
- poetry install --no-root
8 changes: 8 additions & 0 deletions libraries/spell-check/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

Uses [codespell](https://github.com/codespell-project/codespell) to check files for commonly misspelled words.

## DEPRECATION NOTICE

**WARNING: the action is unmaintained and unsupported**

This unmaintained copy is kept only to provide provisional support for existing workflows, but will be removed soon.

The recommended alternative is [the `codespell-project/actions-codespell` action](https://github.com/codespell-project/actions-codespell)

## Inputs

### `ignore-words-list`
Expand Down
2 changes: 2 additions & 0 deletions libraries/spell-check/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
readonly IGNORE_WORDS_LIST="$1"
readonly SKIP_PATHS="$2"

echo "::warning::This action is deprecated. The recommended alternative is codespell-project/actions-codespell."

CODE_SPELL_ARGS=("--skip=${SKIP_PATHS},.git")

if test -f "$IGNORE_WORDS_LIST"; then
Expand Down
22 changes: 22 additions & 0 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[tool.poetry]
name = "actions"
version = "0.0.0"
description = ""
authors = ["Your Name <you@example.com>"]

[tool.poetry.dependencies]
python = "^3.9"

[tool.poetry.dev-dependencies]
codespell = "^2.1.0"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"