-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Showing
6 changed files
with
34 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
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,4 @@ | ||
[codespell] | ||
builtin = usage | ||
ignore-multiline-regex = codespell:ignore-begin.*codespell:ignore-end | ||
context=0 |
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
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 }} |
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