From bf36aae519c45fb0df04cda5b15f59f28cf4eaa4 Mon Sep 17 00:00:00 2001 From: Derek Bekoe Date: Tue, 17 Apr 2018 19:41:39 -0700 Subject: [PATCH] Fix: Auto-generated SDKs keep having to be ignored in test_static.sh #63 (#141) * Fix: Auto-generated SDKs keep having to be ignored in test_static.sh #63 * testing testing testing * Better pylint exclude * fix pep8 * fix again --- scripts/ci/test_static.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/scripts/ci/test_static.sh b/scripts/ci/test_static.sh index c0a3847a857..528544e6221 100755 --- a/scripts/ci/test_static.sh +++ b/scripts/ci/test_static.sh @@ -3,11 +3,19 @@ set -e proc_number=`python -c 'import multiprocessing; print(multiprocessing.cpu_count())'` +AZURE_SDK_AUTOGEN_FILES=$(egrep -lir --exclude-dir site-packages "# Code generated by Microsoft \(R\) AutoRest Code Generator." ./src) +FLAKE8_EXCLUDES=$(echo "$AZURE_SDK_AUTOGEN_FILES" | sed -e s/$/,/g | tr -d '\n') +PYLINT_EXCLUDES=$(echo "$AZURE_SDK_AUTOGEN_FILES" | sed -e s=\./src/=src/=g -e 's%/[^/]*\ %\ %g' -e 's%/[^/]*$%%g' | sort -u | sed -e s/$/,/g | tr -d '\n') + # Run pylint/flake8 on extensions -# - We ignore 'models', 'operations' and files with suffix '_client.py' as they typically come from vendored Azure SDKs -pylint ./src/*/azext_*/ --ignore=models,operations,service_bus_management_client,subscription_client,managementgroups,\ -managementpartner --ignore-patterns=test_*,[a-zA-Z_]+_client.py --rcfile=./pylintrc -j $proc_number -flake8 --statistics --exclude=models,operations,*_client.py,managementgroups,managementpartner --append-config=./.flake8 ./src/*/azext_*/ +echo "Running pylint on extensions..." +pylint ./src/rdbms/azext_rdbms/ --ignore=$PYLINT_EXCLUDES --ignore-patterns=test_* --rcfile=./pylintrc -j $proc_number + + +echo "Pylint OK." +echo "Running flake8 on extensions..." +flake8 --statistics --exclude=$FLAKE8_EXCLUDES --append-config=./.flake8 ./src/*/azext_*/ +echo "Flake8 OK." # Run pylint/flake8 on CI files pylint ./scripts/ci/*.py --rcfile=./pylintrc