Skip to content

Commit

Permalink
ci: Replace woke with codespell
Browse files Browse the repository at this point in the history
woke has been left with Noriko's and all other PRs not being reviewed for years,
hence we have been using our fork.

Replacing woke with codespell that provides a dictionary for replacing phrasing
with recommended terms:
https://github.com/codespell-project/codespell/blob/main/codespell_lib/data/dictionary_usage.txt

It also supports using custom dictionaries so we can add to the list if we want

For more information about inclusive naming initiative, see
https://inclusivenaming.org/about/

Codespell also checks spelling, which is an advantage for system roles because a
big part of our code is user-facing - task names, debug messages, readmes.

`ignore-multiline-regex` in the `.codespellrc` config allows for disabling
codespell for a block of lines:

```
# codespell:ignore-begin
... codespell will not look at this text.
# codespell:ignore-end
```

Signed-off-by: Sergei Petrosian <[email protected]>
  • Loading branch information
spetrosi committed Feb 6, 2025
1 parent 3159fc1 commit ef044e8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[codespell]
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
skip = tests,artifacts*,pylintrc
# skip = tests,artifacts*,pylintrc
builtin = usage
ignore-multiline-regex = codespell:ignore-begin.*codespell:ignore-end
20 changes: 15 additions & 5 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install codespell
run: pip install codespell

- name: Get variable with regex values
id: regexvar
run: |
Expand All @@ -25,7 +22,20 @@ jobs:
echo "$regexvar"
echo "regexvar=$regexvar" >> "$GITHUB_OUTPUT"
# - name: Install codespell
# run: pip install codespell

# - name: Get all changed files
# id: files
# uses: jitterbit/get-changed-files@v1
# with:
# format: 'space-delimited'

- name: Show errors from codespell as annotation in GitHub Actions
uses: codespell-project/codespell-problem-matcher@v1
- name: Run codespell
run: codespell --regex "${{ steps.regexvar.outputs.regexvar }}" -C0
# - name: Run codespell
# run: codespell --regex "${{ steps.regexvar.outputs.regexvar }}" -C0
- name: Codespell
uses: https://github.com/spetrosi/actions-codespell/tree/add-regex-input
with:
regex: ${{ steps.regexvar.outputs.regexvar }}

0 comments on commit ef044e8

Please sign in to comment.