From 4bf6445412846787e081ddf9a1267be268f6ea39 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Fri, 24 Jul 2026 08:36:09 +0200 Subject: [PATCH] py-check.mk: Add target py-check-bad-patterns Add target py-check-bad-patterns, which currently looks for leftover breakpoints and orphaned "export" comments on the closing line of a function prototype. Signed-off-by: Jan Lindemann --- make/py-check.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/make/py-check.mk b/make/py-check.mk index 05687d7c..1c4b4faf 100644 --- a/make/py-check.mk +++ b/make/py-check.mk @@ -44,7 +44,7 @@ format: py-format check-syntax: py-check-syntax check-format: py-check-format -py-check: py-check-syntax py-check-format +py-check: py-check-syntax py-check-format py-check-bad-patterns py-check-syntax: ifneq ($(PY_CHECK_RUFF),) @@ -55,6 +55,10 @@ ifneq ($(PY_CHECK_PYRIGHT),) $(PY_CHECK_PYRIGHT) $(PY_CHECK_ROOTS) endif +py-check-bad-patterns: + if find $(PY_CHECK_ROOTS) -type f -name '*.py' -print0 | xargs -0 grep breakpoint; then exit 1; fi + if find $(PY_CHECK_ROOTS) -type f -name '*.py' -print0 | xargs -0 grep "^\s*).*#\s*export"; then exit 1; fi + py-check-format: ifneq ($(PY_CHECK_YAPF),) $(PY_CHECK_YAPF) --diff --recursive $(PY_CHECK_ROOTS)