Skip to content

Commit

Permalink
Fix warnings in python scripts. (#3874)
Browse files Browse the repository at this point in the history
* Fix Flake8 warnings.
* Enable Flake8 to abort the build even on warnings.
  • Loading branch information
markusthoemmes authored and rabbah committed Jul 13, 2018
1 parent 4346e05 commit 731dbe5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions tools/build/citool
Expand Up @@ -38,10 +38,10 @@ import time
import traceback
import argparse
if sys.version_info.major >= 3:
from http.client import HTTPConnection, HTTPSConnection, IncompleteRead, TEMPORARY_REDIRECT, OK
from http.client import HTTPConnection, HTTPSConnection, TEMPORARY_REDIRECT, OK
from urllib.parse import urlparse
else:
from httplib import HTTPConnection, HTTPSConnection, IncompleteRead, TEMPORARY_REDIRECT, OK
from httplib import HTTPConnection, HTTPSConnection, TEMPORARY_REDIRECT, OK
from urlparse import urlparse
import re
import threading
Expand Down
10 changes: 5 additions & 5 deletions tools/build/redo
Expand Up @@ -278,12 +278,12 @@ Components = [
'build a runtime action container, matching name using the regex; NOTE: must use --dir for path to runtime directory',
yaml = False,
gradle = 'core:$1:distDocker'),
makeComponent('actionproxy',
'build action proxy container',
yaml = False,

makeComponent('actionproxy',
'build action proxy container',
yaml = False,
gradle = 'tools:actionProxy'),

# required for tests
makeComponent('props',
'build whisk.properties file (required for tests)',
Expand Down
6 changes: 3 additions & 3 deletions tools/travis/flake8.sh
Expand Up @@ -30,13 +30,13 @@ do
flake8 "$i" --select=E999,F821 --statistics
RETURN_CODE=$?
if [ $RETURN_CODE != 0 ]; then
echo 'Flake8 found Python 3 syntax errors above. See: https://docs.python.org/3/howto/pyporting.html'
echo 'Flake8 found Python 3 syntax errors above. See: https://docs.python.org/3/howto/pyporting.html'
exit $RETURN_CODE
fi
done

echo 'Flake8: second round uses the --exit-zero flag to treat _every_ message as a warning...'
echo 'Flake8: second round to find any other stylistic issues...'
for i in "${PYTHON_FILES[@]}"
do
flake8 "$i" --ignore=E --max-line-length=127 --statistics --exit-zero
flake8 "$i" --ignore=E --max-line-length=127 --statistics
done

0 comments on commit 731dbe5

Please sign in to comment.