Initial switch to flake8.

This commit is contained in:
Florian Bruhin 2016-01-21 18:11:31 +01:00
parent d5d4e42c64
commit 1952e070fd
4 changed files with 20 additions and 60 deletions

View File

@ -17,9 +17,7 @@ env:
- TESTENV=misc
- TESTENV=vulture
- TESTENV=pep257
- TESTENV=pyflakes
- TESTENV=pep8
- TESTENV=mccabe
- TESTENV=flake8
- TESTENV=pyroma
- TESTENV=check-manifest
- TESTENV=pylint
@ -57,11 +55,7 @@ matrix:
- os: osx
env: TESTENV=pep257
- os: osx
env: TESTENV=pyflakes
- os: osx
env: TESTENV=pep8
- os: osx
env: TESTENV=mccabe
env: TESTENV=flake8
- os: osx
env: TESTENV=pyroma
- os: osx

View File

@ -14,19 +14,6 @@ markers =
skip: Always skipped test.
pyqt531_or_newer: Needs PyQt 5.3.1 or newer.
xfail_norun: xfail the test with out running it
flakes-ignore =
UnusedImport
UnusedVariable
resources.py ALL
pep8ignore =
E265 # Block comment should start with '#'
E501 # Line too long
E402 # module level import not at top of file
E266 # too many leading '#' for block comment
W503 # line break before binary operator
resources.py ALL
.hypothesis/* ALL
mccabe-complexity = 12
qt_log_level_fail = WARNING
qt_log_ignore =
^SpellCheck: .*

12
setup.cfg Normal file
View File

@ -0,0 +1,12 @@
[flake8]
exclude = .venv,.hypothesis,.git,__pycache__,resources.py
# E128: continuation line under-indented for visual indent
# E226: missing whitespace around arithmetic operator
# E265: Block comment should start with '#'
# E501: Line too long
# E402: module level import not at top of file
# E266: too many leading '#' for block comment
# W503: line break before binary operator
# F401: Unused import
ignore = E128,E226,E265,E501,E402,E266,W503,F401
max-complexity = 12

45
tox.ini
View File

@ -4,7 +4,7 @@
# and then run "tox" from this directory.
[tox]
envlist = py34,py35,misc,vulture,pep257,pyflakes,pep8,mccabe,pylint,pyroma,check-manifest
envlist = py34,py35,misc,vulture,pep257,flake8,pylint,pyroma,check-manifest
[testenv]
# https://bitbucket.org/hpk42/tox/issue/246/ - only needed for Windows though
@ -147,50 +147,17 @@ deps = pep257==0.7.0
# D402: First line should not be function's signature (false-positives)
commands = {envpython} -m pep257 scripts tests qutebrowser --ignore=D102,D103,D104,D105,D209,D211,D402 '--match=(?!resources|test_*).*\.py'
[testenv:pyflakes]
basepython = python3
# https://github.com/fschulze/pytest-flakes/issues/6
setenv = LANG=en_US.UTF-8
passenv =
deps =
-r{toxinidir}/requirements.txt
apipkg==1.4
execnet==1.4.1
py==1.4.31
pyflakes==1.0.0
pytest==2.8.5
pytest-flakes==1.0.1
commands =
{envpython} -m py.test -q --flakes --ignore=tests --noconftest
[testenv:pep8]
[testenv:flake8]
basepython = python3
passenv =
deps =
-r{toxinidir}/requirements.txt
apipkg==1.4
execnet==1.4.1
pep8==1.7
py==1.4.31
pytest==2.8.5
pytest-pep8==1.0.6
commands =
{envpython} -m py.test -q --pep8 --ignore=tests --noconftest
[testenv:mccabe]
basepython = python3
passenv =
deps =
-r{toxinidir}/requirements.txt
apipkg==1.4
execnet==1.4.1
flake8==2.5.1
mccabe==0.3.1
py==1.4.31
pytest==2.8.5
pytest-mccabe==0.1
pep8==1.7.0
pyflakes==1.0.0
commands =
{envpython} -m py.test -q --mccabe --ignore=tests --noconftest
{envpython} -m flake8
[testenv:pyroma]
basepython = python3