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 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]>
  • Loading branch information
spetrosi committed Feb 7, 2025
1 parent 6d215f7 commit f73176f
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ kinds:
skip_list:
- fqcn-builtins
- var-naming[no-role-prefix]
- sanity[cannot-ignore] # wokeignore:rule=sanity
- sanity[cannot-ignore]
exclude_paths:
- tests/roles/
- .github/
Expand Down
4 changes: 4 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[codespell]
builtin = usage
ignore-multiline-regex = codespell:ignore-begin.*codespell:ignore-end
context=0
2 changes: 1 addition & 1 deletion .github/workflows/ansible-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ jobs:
- name: Run ansible-test
uses: ansible-community/ansible-test-gh-action@release/v1
with:
testing-type: sanity # wokeignore:rule=sanity
testing-type: sanity
ansible-core-version: stable-2.17
collection-src-directory: ${{ github.workspace }}/.tox/ansible_collections/${{ env.LSR_ROLE2COLL_NAMESPACE }}/${{ env.LSR_ROLE2COLL_NAME }}
27 changes: 27 additions & 0 deletions .github/workflows/detect_non_inclusive_language.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Codespell configuration is within .codespellrc
---
name: Detect non-inclusive language
on: # yamllint disable-line rule:truthy
- pull_request
permissions:
contents: read
jobs:
codespell:
name: Detect non-inclusive language
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Get variable with regex values
id: regexvar
run: |
curl -L -s -o dictionary_usage.txt https://raw.githubusercontent.com/codespell-project/codespell/refs/heads/main/codespell_lib/data/dictionary_usage.txt
regexvar=$(sed 's/->.*//g' dictionary_usage.txt | sed 's/$/|/' | tr -d '\n' | sed 's/.$//')
rm dictionary_usage.txt
echo "regexvar=$regexvar" >> "$GITHUB_OUTPUT"
- name: Detect non-inclusive language with codespell
uses: spetrosi/actions-codespell@add-regex-input
with:
regex: ${{ steps.regexvar.outputs.regexvar }}
20 changes: 0 additions & 20 deletions .github/workflows/woke.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# timesync

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

This role installs and configures an NTP and/or PTP implementation to operate
<!--- wokeignore:rule=slave -->

Check failure on line 6 in README.md

View workflow job for this annotation

GitHub Actions / Detect non-inclusive language

slave ==> secondary, follower, standby, replica, reader, worker, helper, subordinate, subsystem
Expand Down

0 comments on commit f73176f

Please sign in to comment.