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 <jan@janware.com>
This commit is contained in:
parent
dcbe959843
commit
4bf6445412
1 changed files with 5 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue