Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Auto-generated SDKs keep having to be ignored in test_static.sh #63 #141

Merged
merged 5 commits into from
Apr 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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