From 6ebe0c2b4e1f1d989a2fc7110ed80c8a02f785f9 Mon Sep 17 00:00:00 2001 From: Daniel Tobias Date: Tue, 13 Aug 2024 15:28:25 +1000 Subject: [PATCH] add codespell CI action (#1190) * add codespell CI action * use latest available codespell dictionaries --- .github/workflows/codespell-ignored-words.txt | 6 +++ .github/workflows/codespell.yml | 37 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 .github/workflows/codespell-ignored-words.txt create mode 100644 .github/workflows/codespell.yml diff --git a/.github/workflows/codespell-ignored-words.txt b/.github/workflows/codespell-ignored-words.txt new file mode 100644 index 00000000..961aa75b --- /dev/null +++ b/.github/workflows/codespell-ignored-words.txt @@ -0,0 +1,6 @@ +fram +iterm +ntegral +numer +numers +wel diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 00000000..1822fce5 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,37 @@ +name: Run codespell + +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: [ master ] + pull_request: + branches: [ master ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + codespell: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + # codespell is not installed in the runner by default + - name: install codespell + run: | + sudo apt update + sudo apt install codespell + + - name: identify codespell + run: codespell --version + + # use latest available dictionaries + - name: update dictionary + run: | + curl --output-dir /tmp --remote-name https://raw.githubusercontent.com/codespell-project/codespell/master/codespell_lib/data/dictionary.txt + curl --output-dir /tmp --remote-name https://raw.githubusercontent.com/codespell-project/codespell/master/codespell_lib/data/dictionary_rare.txt + + # If count >0 will trigger a workflow failure, else success + - name: run codespell + run: codespell --dictionary=/tmp/dictionary.txt --dictionary=/tmp/dictionary_rare.txt --ignore-words=./.github/workflows/codespell-ignored-words.txt --count ./speeduino/