diff --git a/.travis.yml b/.travis.yml index 3761c38e2..925354477 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/pytest.ini b/pytest.ini index 962fdeafe..c408f209c 100644 --- a/pytest.ini +++ b/pytest.ini @@ -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: .* diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 000000000..d417f3c1f --- /dev/null +++ b/setup.cfg @@ -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 diff --git a/tox.ini b/tox.ini index f9d9b2d08..12ee382b4 100644 --- a/tox.ini +++ b/tox.ini @@ -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