Skip to content

Commit 6b2457b

Browse files
committed
ci: Replace woke with codespell
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 to detect non-inclusive language Codespell provides a built-in dictionary with recommended non-inclusive terms: https://github.com/codespell-project/codespell/blob/main/codespell_lib/data/dictionary_usage.txt Codespell supports using custom dictionaries so we can add to the list if we want. `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 ``` You can ignore words inline by adding a comment like `# codespell:ignore word`. You can ignore files and directories, or words by adding them to config file `.codespellrc`. linux-system-roles do NOT use codespell to check spelling in code. For more information about inclusive naming initiative, see https://inclusivenaming.org/about/ Signed-off-by: Sergei Petrosian <[email protected]>
1 parent b06ec6b commit 6b2457b

File tree

6 files changed

+66
-22
lines changed

6 files changed

+66
-22
lines changed

.codespellrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[codespell]
2+
builtin = usage
3+
ignore-multiline-regex = codespell:ignore-begin.*codespell:ignore-end
4+
context=0

.github/workflows/ansible-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ jobs:
4343
- name: Run ansible-test
4444
uses: ansible-community/ansible-test-gh-action@release/v1
4545
with:
46-
testing-type: sanity # wokeignore:rule=sanity
46+
testing-type: sanity
4747
ansible-core-version: stable-2.17
4848
collection-src-directory: ${{ github.workspace }}/.tox/ansible_collections/${{ env.LSR_ROLE2COLL_NAMESPACE }}/${{ env.LSR_ROLE2COLL_NAME }}

.github/workflows/codespell.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Codespell configuration is within .codespellrc
2+
---
3+
name: Codespell
4+
on: # yamllint disable-line rule:truthy
5+
- pull_request
6+
permissions:
7+
contents: read
8+
jobs:
9+
codespell:
10+
name: Check for spelling errors
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Get variable with regex values
17+
id: regexvar
18+
run: |
19+
curl -L -s -o dictionary_usage.txt https://raw.githubusercontent.com/codespell-project/codespell/refs/heads/main/codespell_lib/data/dictionary_usage.txt
20+
regexvar=$(sed 's/->.*//g' dictionary_usage.txt | sed 's/$/|/' | tr -d '\n' | sed 's/.$//')
21+
rm dictionary_usage.txt
22+
echo "regexvar=$regexvar" >> "$GITHUB_OUTPUT"
23+
24+
- name: Show errors from codespell as annotation in GitHub Actions
25+
uses: codespell-project/codespell-problem-matcher@v1
26+
27+
- name: Codespell
28+
uses: spetrosi/actions-codespell@add-regex-input
29+
with:
30+
regex: ${{ steps.regexvar.outputs.regexvar }}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Codespell configuration is within .codespellrc
2+
---
3+
name: Detect non-inclusive language
4+
on: # yamllint disable-line rule:truthy
5+
- pull_request
6+
permissions:
7+
contents: read
8+
jobs:
9+
codespell:
10+
name: Detect non-inclusive language
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Get variable with regex values
17+
id: regexvar
18+
run: |
19+
curl -L -s -o dictionary_usage.txt https://raw.githubusercontent.com/codespell-project/codespell/refs/heads/main/codespell_lib/data/dictionary_usage.txt
20+
regexvar=$(sed 's/->.*//g' dictionary_usage.txt | sed 's/$/|/' | tr -d '\n' | sed 's/.$//')
21+
rm dictionary_usage.txt
22+
echo "regexvar=$regexvar" >> "$GITHUB_OUTPUT"
23+
24+
- name: Show errors from codespell as annotation in GitHub Actions
25+
uses: codespell-project/codespell-problem-matcher@v1
26+
27+
- name: Detect non-inclusive language with codespell
28+
uses: spetrosi/actions-codespell@add-regex-input
29+
with:
30+
regex: ${{ steps.regexvar.outputs.regexvar }}

.github/workflows/woke.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Role Name
22

3-
[![ansible-lint.yml](https://github.com/linux-system-roles/template/actions/workflows/ansible-lint.yml/badge.svg)](https://github.com/linux-system-roles/template/actions/workflows/ansible-lint.yml) [![ansible-test.yml](https://github.com/linux-system-roles/template/actions/workflows/ansible-test.yml/badge.svg)](https://github.com/linux-system-roles/template/actions/workflows/ansible-test.yml) [![markdownlint.yml](https://github.com/linux-system-roles/template/actions/workflows/markdownlint.yml/badge.svg)](https://github.com/linux-system-roles/template/actions/workflows/markdownlint.yml) [![shellcheck.yml](https://github.com/linux-system-roles/template/actions/workflows/shellcheck.yml/badge.svg)](https://github.com/linux-system-roles/template/actions/workflows/shellcheck.yml) [![tft.yml](https://github.com/linux-system-roles/template/actions/workflows/tft.yml/badge.svg)](https://github.com/linux-system-roles/template/actions/workflows/tft.yml) [![tft_citest_bad.yml](https://github.com/linux-system-roles/template/actions/workflows/tft_citest_bad.yml/badge.svg)](https://github.com/linux-system-roles/template/actions/workflows/tft_citest_bad.yml) [![woke.yml](https://github.com/linux-system-roles/template/actions/workflows/woke.yml/badge.svg)](https://github.com/linux-system-roles/template/actions/workflows/woke.yml)
3+
[![ansible-lint.yml](https://github.com/linux-system-roles/template/actions/workflows/ansible-lint.yml/badge.svg)](https://github.com/linux-system-roles/template/actions/workflows/ansible-lint.yml) [![ansible-test.yml](https://github.com/linux-system-roles/template/actions/workflows/ansible-test.yml/badge.svg)](https://github.com/linux-system-roles/template/actions/workflows/ansible-test.yml) [![codespell.yml](https://github.com/linux-system-roles/template/actions/workflows/codespell.yml/badge.svg)](https://github.com/linux-system-roles/template/actions/workflows/codespell.yml) [![detect_non_inclusive_language.yml](https://github.com/linux-system-roles/template/actions/workflows/detect_non_inclusive_language.yml/badge.svg)](https://github.com/linux-system-roles/template/actions/workflows/detect_non_inclusive_language.yml) [![markdownlint.yml](https://github.com/linux-system-roles/template/actions/workflows/markdownlint.yml/badge.svg)](https://github.com/linux-system-roles/template/actions/workflows/markdownlint.yml) [![shellcheck.yml](https://github.com/linux-system-roles/template/actions/workflows/shellcheck.yml/badge.svg)](https://github.com/linux-system-roles/template/actions/workflows/shellcheck.yml) [![tft.yml](https://github.com/linux-system-roles/template/actions/workflows/tft.yml/badge.svg)](https://github.com/linux-system-roles/template/actions/workflows/tft.yml) [![tft_citest_bad.yml](https://github.com/linux-system-roles/template/actions/workflows/tft_citest_bad.yml/badge.svg)](https://github.com/linux-system-roles/template/actions/workflows/tft_citest_bad.yml)
44

55
![template](https://github.com/linux-system-roles/template/workflows/tox/badge.svg)
66

0 commit comments

Comments
 (0)