[ci,codespell] add workflow running codespell

This commit is contained in:
akallabeth
2024-11-21 09:59:46 +01:00
parent 91380a60b9
commit 6e7feb8080
4 changed files with 63 additions and 1 deletions

21
scripts/codespell.ignore Normal file
View File

@@ -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

15
scripts/codespell.sh Executable file
View File

@@ -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/..