summaryrefslogtreecommitdiff
path: root/tools/check_commit.sh
diff options
context:
space:
mode:
authorDave Hibberd <hibby@debian.org>2026-10-31 12:31:46 +0000
committerDave Hibberd <hibby@debian.org>2026-10-31 12:31:46 +0000
commitdd07cc494d2f8a342ee0556a593b068800f9da5b (patch)
tree07f455fe694b4a47959b76e9f93c0306690bc6a2 /tools/check_commit.sh
parentaa0d17d5ad14d671e5ce02cb90f814e0a96fad98 (diff)
parentef0af95bac2c3d310fe55f54853904395b57f884 (diff)
Update upstream source from tag 'upstream/20261030'
Update to upstream version '20261030' with Debian dir 82dda47c52fda693a8e3b8228e4043c187b8dcfc
Diffstat (limited to 'tools/check_commit.sh')
-rwxr-xr-xtools/check_commit.sh30
1 files changed, 21 insertions, 9 deletions
diff --git a/tools/check_commit.sh b/tools/check_commit.sh
index 9273912..5b8887c 100755
--- a/tools/check_commit.sh
+++ b/tools/check_commit.sh
@@ -17,28 +17,29 @@ git log --pretty=oneline --no-merges --abbrev-commit ${BASE}..
echo
git diff ${BASE}.. -- '*.py' | grep '^+' > added_lines
+git diff ${BASE}.. -- 'chirp/drivers/*.py' | grep '^+' > driver_lines
-if grep -E '(from|import).*six' added_lines; then
- fail No new uses of future
+if grep -E '\<(from|import)\>.*\<six\>' added_lines; then
+ fail No new uses of six
fi
-if grep -E '\wsix\w' added_lines; then
+if grep -E '\<six\>' added_lines; then
fail No new uses of six
fi
-if grep -E '(from|import).*builtins' added_lines; then
+if grep -E '\<(from|import)\>.*builtins' added_lines; then
fail No new uses of future
fi
-if grep -E '\wfuture\w' added_lines; then
+if grep -E '\<future\>' added_lines; then
fail No new uses of future
fi
-if grep -E '(from|import).*past(?!e)' added_lines; then
+if grep -E '\<(from|import)\>.*\<past\>' added_lines; then
fail Use of past library not allowed
fi
-if grep -E 'MemoryMap\(' added_lines; then
+if grep -E '\<MemoryMap\(' added_lines; then
fail New uses of MemoryMap should be MemoryMapBytes
fi
@@ -46,7 +47,7 @@ if grep -E "[^_]_\([^\"']" added_lines; then
fail 'Translated strings must be literals!'
fi
-if grep -E "eval\(" added_lines; then
+if grep -E "\<eval\(" added_lines; then
fail 'Use of eval() is dangerous and not permitted!'
fi
@@ -73,15 +74,26 @@ done
# fail 'New drivers should not have match_model() implemented as it is not needed'
#fi
-if grep -E '\Wprint\(' added_lines; then
+if grep -E '\<print\(' added_lines; then
fail 'Do not use print()'
fi
+if grep -E '\<(from|import)\>.*wx' driver_lines; then
+ fail 'Drivers may not import GUI components or manipulate the GUI'
+fi
+
+if grep -E '(subprocess|webbrowser)' driver_lines; then
+ fail 'Drivers may not spawn external commands'
+fi
+
if git log ${BASE}.. --merges | grep .; then
fail Please do not include merge commits in your PR
fi
make -C chirp/locale clean all >/dev/null 2>&1
+if [ $? -ne 0 ]; then
+ fail Locale build failed
+fi
if git diff -- chirp/locale | grep '^+[^#+]' | grep -v POT-Creation; then
fail Locale files need updating
fi