Add lint-py type checking using mypy

This commit is contained in:
Wilson Snyder 2025-11-01 14:15:39 -04:00
parent 782fe1daf2
commit cd8af21915
2 changed files with 12 additions and 2 deletions

View File

@ -37,7 +37,7 @@ jobs:
# We use specific version numbers, otherwise a Python package
# update may add a warning and break our build
- name: Install packages for lint
run: sudo pip3 install pylint==3.0.2 ruff==0.1.3 clang sphinx sphinx_rtd_theme sphinxcontrib-spelling breathe ruff
run: sudo pip3 install mypy==1.18.2 pylint==3.0.2 ruff==0.1.3 clang sphinx sphinx_rtd_theme sphinxcontrib-spelling breathe ruff
- name: Configure
run: autoconf && ./configure --enable-longtests --enable-ccwarn

View File

@ -563,7 +563,17 @@ RUFF_FLAGS = check --ignore=E402,E501,E701
# "make -k" so can see all tool result errors
lint-py:
$(MAKE) -k lint-py-pylint lint-py-pylint-tests lint-py-ruff
$(MAKE) -k lint-py-mypy lint-py-mypy-none lint-py-pylint lint-py-pylint-tests lint-py-ruff
lint-py-mypy:
for filename in `fgrep -l '# mypy' $(PY_PROGRAMS)`; do \
echo "$(MYPY) $(MYPY_FLAGS) $$filename" ; \
$(MYPY) $(MYPY_FLAGS) $$filename ; \
done
@echo "Not mypy checked: " `fgrep -L '# mypy' $(PY_PROGRAMS)`
lint-py-mypy-none:
@echo "mypy not checking: " `fgrep -L '# mypy' $(PY_PROGRAMS)`
lint-py-mypy:
for filename in `fgrep -l '# mypy' $(PY_PROGRAMS)`; do \