diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 000000000..15fd13f42 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,26 @@ +name: codespell +on: + workflow_dispatch: + branches: [ master, stable* ] + pull_request: + branches: [ master, stable* ] + schedule: + - cron: '30 4 * * SUN' + +jobs: + build: + runs-on: ubuntu-latest + name: "codespell" + steps: + - name: "Check out source" + uses: actions/checkout@v4 + + - name: "Prepare environment" + run: | + sudo apt-get update -q -y + sudo apt-get install -q -y \ + codespell + + - name: "Run codespell..." + run: | + ./scripts/codespell.sh diff --git a/ChangeLog b/ChangeLog index 2c94407df..b4b3562c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -69,7 +69,7 @@ contains a number of improvements for distributors: Windows 7 RFX and bitmap updates with multiple rectangles have been deactivated, so adjust shadow to not send such. Noteworthy changes: -* Fix ActionScript paramter (#10423) +* Fix ActionScript parameter (#10423) * Support keyboard layouts as JSON resource (#10394) * Support timezones as JSON resource and command line argument (#10428 #10393 #10391) * Deactivate AsyncUpdate (#10402) diff --git a/scripts/codespell.ignore b/scripts/codespell.ignore new file mode 100644 index 000000000..35bf42c09 --- /dev/null +++ b/scripts/codespell.ignore @@ -0,0 +1,21 @@ +nin +pres +ptd +statics +inout +ontext +clen +usera +fom +fle +parm +tolen +psuh +larg +varn +wight +resizeable +wan +bre +sur +numer diff --git a/scripts/codespell.sh b/scripts/codespell.sh new file mode 100755 index 000000000..b7299b4ea --- /dev/null +++ b/scripts/codespell.sh @@ -0,0 +1,15 @@ +#!/bin/bash -x + +SCRIPT_PATH=$(dirname "${BASH_SOURCE[0]}") +SCRIPT_PATH=$(realpath "$SCRIPT_PATH") + +# ignore the following regular expressions: +# +# 1. All words consisting of only 2 characters (too many issues with variable names) +# 2. Every word of the form 'pEvent', e.g. variable prefixed with p for pointer +# 3. Every word prefixed by e.g. '\tSome text', e.g. format string escapes +codespell \ + -I "$SCRIPT_PATH/codespell.ignore" \ + -S ".git,*.ai,*.svg,*.rtf,*/assets/de_*,*/res/values-*,*/protocols/xdg*,*/test/*" \ + --ignore-regex "\b[a-zA-Z][a-zA-Z]\b|\bp[A-Z].*|\\\\[a-z][a-zA-Z].*" \ + --count $SCRIPT_PATH/..