Use pycodestyle instead of pep8, fix its warnings and config

This commit is contained in:
Peter Melnichenko 2018-07-10 20:07:27 +03:00
parent 49b8acac6e
commit 68d9caef5a
4 changed files with 9 additions and 11 deletions

View File

@ -12,11 +12,11 @@ matrix:
language: generic
install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo pip2 install pyflakes pep8 coverage coveralls nose; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then pip install pyflakes pep8 coverage coveralls nose; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo pip2 install pyflakes pycodestyle coverage coveralls nose; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then pip install pyflakes pycodestyle coverage coveralls nose; fi
script:
- pyflakes .
- pep8 .
- pycodestyle .
- nosetests
- coveralls

View File

@ -7,11 +7,11 @@ environment:
build_script:
- PATH %CD%\here\bin;C:\mingw\bin;C:\python%Python%;C:\python%Python%\scripts;%PATH%
- pip install pyflakes pep8 coverage coveralls nose
- pip install pyflakes pycodestyle coverage coveralls nose
test_script:
- pyflakes .
- pep8 .
- pycodestyle .
- nosetests
- coverage report
- if not "%COVERALLS_REPO_TOKEN%"=="" coveralls

View File

@ -154,7 +154,7 @@ def write_activation_scripts():
"LOCATION_DQ": opts.location.replace("\\", "\\\\").replace('"', '\\"'),
"LOCATION_SQ": opts.location.replace("'", "'\\''"),
"LOCATION_NESTED_SQ": opts.location.replace("'", "'\\''").replace("'", "'\\''"),
"LOCATION_PAREN": re.sub("[&,=()]", "^\g<0>", opts.location)
"LOCATION_PAREN": re.sub("[&,=()]", r"^\g<0>", opts.location)
}
for template_name in template_names:
@ -165,9 +165,7 @@ def write_activation_scripts():
script_handle.write(script)
def is_executable(path):
return (os.path.exists(path) and
os.access(path, os.F_OK | os.X_OK) and
not os.path.isdir(path))
return os.path.exists(path) and os.access(path, os.F_OK | os.X_OK) and not os.path.isdir(path)
def program_exists(prog):
path = os.environ.get("PATH", os.defpath)

View File

@ -1,2 +1,2 @@
[pep8]
ignore = E203,E302,E501
[pycodestyle]
ignore = E203,E302,E305,E501