From 5f4fe8ab00a12060662e5df0fc8855f0488de35d Mon Sep 17 00:00:00 2001 From: Dave Hibberd Date: Thu, 20 Aug 2026 23:11:02 +0100 Subject: New upstream version 20260814 --- tools/check_commit.sh | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'tools') diff --git a/tools/check_commit.sh b/tools/check_commit.sh index 9273912..ac95ef5 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)\>.*\' added_lines; then + fail No new uses of six fi -if grep -E '\wsix\w' added_lines; then +if grep -E '\' 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 '\' 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)\>.*\' added_lines; then fail Use of past library not allowed fi -if grep -E 'MemoryMap\(' added_lines; then +if grep -E '\.*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 -- cgit v1.2.3