Skip to content

Commit

Permalink
Fix: Auto-generated SDKs keep having to be ignored in test_static.sh #63
Browse files Browse the repository at this point in the history
 (#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
  • Loading branch information
derekbekoe authored Apr 18, 2018
1 parent 70d1715 commit bf36aae
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions scripts/ci/test_static.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bf36aae

Please sign in to comment.