-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
685861e
commit 34be617
Showing
2 changed files
with
50 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Note: This workflow allows specifying a custom location for the Codespell | ||
# configuration file by defining CONFIG_FILE as an environment variable. | ||
# A defined subset of options is extracted from this file and passed to the | ||
# Codespell action. This also ensures that the output of the codespell action | ||
# prints out the values of these options. | ||
# Todo: Generalize the extraction of codespell input arguments/options. | ||
|
||
name: Codespell | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
- add/developer-tools | ||
|
||
jobs: | ||
codespell: | ||
name: Check for spelling errors | ||
runs-on: ubuntu-latest | ||
env: | ||
CONFIG_FILE: tools/.codespellrc | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Extract codespell configurations from configuration file | ||
id: config | ||
run: | | ||
# Extract 'skip' value from the config file, excluding 'skip = ' part | ||
skip=$(grep -E '^skip' "$CONFIG_FILE" | sed 's/^skip *= *//') | ||
# Extract 'ignore-words-list' value from the config file, excluding 'ignore-words-list = ' part | ||
ignore_words=$(grep -E '^ignore-words-list' "$CONFIG_FILE" | sed 's/^ignore-words-list *= *//') | ||
# Export values as environment variables | ||
echo "SKIP=$skip" >> $GITHUB_ENV | ||
echo "IGNORE_WORDS_LIST=$ignore_words" >> $GITHUB_ENV | ||
- name: Codespell | ||
uses: codespell-project/actions-codespell@v2 | ||
with: | ||
skip: "${{ env.SKIP }}" | ||
ignore_words_list: "${{ env.IGNORE_WORDS_LIST }}" |
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,3 @@ | ||
[codespell] | ||
skip = *.prj,*/code/+om/+external/**/*.m,*/code/external/* | ||
ignore-words-list = hAx,hTmp,quicky,dataS,whos,siz,strIn,nd,mis,Mis,pixelX,listIn,assignin,doubleclick,ans |