pyln: Ignore generated files when linting

This commit is contained in:
Christian Decker 2022-07-11 18:11:47 +02:00 committed by Rusty Russell
parent aa82a96034
commit 20b2f0af85
2 changed files with 6 additions and 2 deletions

View File

@ -81,7 +81,11 @@ endif
PYTEST_OPTS := -v -p no:logging $(PYTEST_OPTS)
MY_CHECK_PYTHONPATH=$${PYTHONPATH}$${PYTHONPATH:+:}$(shell pwd)/contrib/pyln-client:$(shell pwd)/contrib/pyln-testing:$(shell pwd)/contrib/pyln-proto/:$(shell pwd)/external/lnprototest:$(shell pwd)/contrib/pyln-spec/bolt1:$(shell pwd)/contrib/pyln-spec/bolt2:$(shell pwd)/contrib/pyln-spec/bolt4:$(shell pwd)/contrib/pyln-spec/bolt7
# Collect generated python files to be excluded from lint checks
PYTHON_GENERATED=
PYTHON_GENERATED= \
contrib/pyln-testing/pyln/testing/primitives_pb2.py \
contrib/pyln-testing/pyln/testing/node_pb2_grpc.py \
contrib/pyln-testing/pyln/testing/node_pb2.py \
contrib/pyln-testing/pyln/testing/grpc2py.py
# Options to pass to cppcheck. Mostly used to exclude files that are
# generated with external tools that we don't have control over

View File

@ -19,7 +19,7 @@ check: check-source check-pytest
check-source: check-flake8 check-mypy
check-flake8:
flake8 --ignore=E501,E731,W503,E741 pyln tests
flake8 --ignore=E501,E731,W503,E741 --exclude '*_pb2*.py,grpc2py.py' pyln tests
check-pytest:
pytest tests