py-topdir.mk: py-format|check-annotation-imports
Add two new targets, basically
py-check-annotation-imports: ruff check --select TC,FA --fix --unsafe-fixes .py-format-annotation-imports: ruff format --select TC,FA --fix --unsafe-fixes .They basically import statements merely used for annotation only during type checking runs:
if TYPE_CHECKING: import AirFrobnicator from frobnicationSigned-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
82101ce4a6
commit
fdabca79e8
1 changed files with 10 additions and 0 deletions
|
|
@ -45,6 +45,16 @@ py-format-assignments:
|
|||
-execdir /usr/bin/sed -i 's/^\(\s\+[a-zA-Z0-9_]\+\)=\([^,[:space:]]\+\)\([,(]\)*\s*$$/\1 = \2\3/g' {} '+'
|
||||
git diff --exit-code
|
||||
|
||||
py-check-annotation-imports:
|
||||
ifneq ($(PY_CHECK_RUFF),)
|
||||
$(PY_CHECK_RUFF) check --select TC,FA --diff --unsafe-fixes .
|
||||
endif
|
||||
|
||||
py-format-annotation-imports:
|
||||
ifneq ($(PY_CHECK_RUFF),)
|
||||
$(PY_CHECK_RUFF) check --select TC,FA --fix --unsafe-fixes .
|
||||
endif
|
||||
|
||||
clean.topdir: clean.py-check
|
||||
clean.py-check:
|
||||
rm -rf .mypy_cache
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue