From 7b9fcdc2d54d89aba4e8c1d6f43e7fda9b2cce54 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Mon, 25 Feb 2019 20:26:06 +0100 Subject: [PATCH] Fix pylint errors going uncaught Make check-python-files.sh run pylint on all *.py files (in directories where they are known to be present), rather than list files explicitly. Fix a bug whereby the return status of check-python-files.sh was only based on the last file passing, i.e. errors in other files were effectively ignored. Make check-python-files.sh run pylint unconditionally. Since pylint3 is not critical, make all.sh to skip running check-python-files.sh if pylint3 is not available. --- tests/scripts/all.sh | 3 +++ tests/scripts/check-python-files.sh | 8 +------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 039b1b887..8acb0b4d8 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -1237,6 +1237,9 @@ component_test_zeroize () { unset gdb_disable_aslr } +support_check_python_files () { + type pylint3 >/dev/null 2>/dev/null +} component_check_python_files () { msg "Lint: Python scripts" record_status tests/scripts/check-python-files.sh diff --git a/tests/scripts/check-python-files.sh b/tests/scripts/check-python-files.sh index e64d6b331..929041822 100755 --- a/tests/scripts/check-python-files.sh +++ b/tests/scripts/check-python-files.sh @@ -9,10 +9,4 @@ # Run 'pylint' on Python files for programming errors and helps enforcing # PEP8 coding standards. -if `hash pylint3 > /dev/null 2>&1`; then - pylint3 -j 2 tests/scripts/generate_test_code.py - pylint3 -j 2 tests/scripts/test_generate_test_code.py - pylint3 -j 2 tests/scripts/mbedtls_test.py -else - echo "$0: WARNING: 'pylint3' not found! Skipping checks on Python files." -fi +pylint3 -j 2 scripts/*.py tests/scripts/*.py