diff --git a/.github/workflows/code_checks.yml b/.github/workflows/code_checks.yml index d3852768e0..381f88eb1f 100644 --- a/.github/workflows/code_checks.yml +++ b/.github/workflows/code_checks.yml @@ -39,5 +39,7 @@ jobs: pip3 install --no-warn-script-location codespell==1.17.1 - name: Run codespell + env: + CODESPELL: $HOME/.local/bin/codespell run: | - $HOME/.local/bin/codespell -I misc/suppressions/codespell-words -x misc/suppressions/codespell-lines -S 'docs/changes.txt,docs/changes_30.txt,*.png,*.ico,*.bmp,*.cur,docs/doxygen/images' README.md docs include interface + ./misc/scripts/spellcheck diff --git a/misc/scripts/spellcheck b/misc/scripts/spellcheck new file mode 100755 index 0000000000..ea6c69dddc --- /dev/null +++ b/misc/scripts/spellcheck @@ -0,0 +1,32 @@ +#!/bin/sh +CODESPELL=${CODESPELL-codespell} + +# Make sure we run codespell from the top wx directory. +cd `dirname "$0"`/../.. + +if ! command -v $CODESPELL > /dev/null; then + echo "ERROR: codespell not available." >&2 + exit 127 +fi + +$CODESPELL \ + -I misc/suppressions/codespell-words \ + -x misc/suppressions/codespell-lines \ + -S 'docs/changes.txt,docs/changes_30.txt,*.png,*.ico,*.bmp,*.cur,docs/doxygen/images' \ + README.md docs include interface + +rc=$? + +if [ $rc != 0 ]; then + cat <& 2 + exit $rc +fi