From e52a6623c5334d4dcc53788c2558af5a74998a17 Mon Sep 17 00:00:00 2001 From: mozga-intel Date: Wed, 20 Oct 2021 12:00:31 +0200 Subject: [PATCH] Add prospector to check python style --- ci/docker/runtime_functions.sh | 12 ++++++------ requirements-flake8.txt | 5 ----- requirements-prospector.txt | 1 + 3 files changed, 7 insertions(+), 11 deletions(-) delete mode 100644 requirements-flake8.txt create mode 100644 requirements-prospector.txt diff --git a/ci/docker/runtime_functions.sh b/ci/docker/runtime_functions.sh index b83a14e504b8..2dca7ae03f08 100755 --- a/ci/docker/runtime_functions.sh +++ b/ci/docker/runtime_functions.sh @@ -704,7 +704,7 @@ sanity_check() { sanity_clang sanity_license sanity_python - sanity_python_flake8 + sanity_python_prospector sanity_cpp } @@ -713,17 +713,17 @@ sanity_license() { tools/license_header.py check } -sanity_python_flake8() { +sanity_python_prospector() { set -ex # Install dependencies - pip3 install -r requirements-flake8.txt --user + pip3 install -r requirements-prospector.txt --user # Run flake8 - python3 -m flake8 | tee flake8-output.txt + python3 -m prospector | tee prospector-output.txt - if [ -s flake8-output.txt ]; then - echo 'Please fix the above Flake8 warnings.' + if [ -s prospector-output.txt ]; then + echo 'Please fix the above Prospector warnings.' exit 1 fi exit 0 diff --git a/requirements-flake8.txt b/requirements-flake8.txt deleted file mode 100644 index eee31f4d7eb3..000000000000 --- a/requirements-flake8.txt +++ /dev/null @@ -1,5 +0,0 @@ -flake8==3.8.2 -flake8-pyi==20.5.0 -flake8-bugbear==20.1.4 -flake8-comprehensions==3.3.0 -flake8-executable==2.0.4 \ No newline at end of file diff --git a/requirements-prospector.txt b/requirements-prospector.txt new file mode 100644 index 000000000000..02838919256d --- /dev/null +++ b/requirements-prospector.txt @@ -0,0 +1 @@ +prospector \ No newline at end of file