From 20b2f0af855e78175e46e4661e0fc72fc5e2cd8c Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Mon, 11 Jul 2022 18:11:47 +0200 Subject: [PATCH] pyln: Ignore generated files when linting --- Makefile | 6 +++++- contrib/pyln-testing/Makefile | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 40dcde7b5..83e9d4e0f 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/contrib/pyln-testing/Makefile b/contrib/pyln-testing/Makefile index 4ad0ba390..9f19b9d59 100644 --- a/contrib/pyln-testing/Makefile +++ b/contrib/pyln-testing/Makefile @@ -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