summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Morley <edmorley@users.noreply.github.com>2017-06-02 18:30:19 +0100
committerEd Morley <edmorley@users.noreply.github.com>2017-06-02 18:31:18 +0100
commitd7396604d0718012336ed6c9201e91a71cb323a9 (patch)
treed3f9b4ca5791686613d333e2e87c382e15f636ce
parent455782a461d2fc4e44f9f35a05e9704062b2597f (diff)
downloadisort-d7396604d0718012336ed6c9201e91a71cb323a9.tar.gz
Increase flake8 coverage
Enables more of flake8's default rules and makes CI check all files, not just a subset. Also pins the version of flake8 to avoid CI non-determinism when newer versions add/adjust the default rules. The `# noqa: F401` entries in `pie_slice.py` are required due to: https://github.com/PyCQA/pyflakes/issues/276
-rw-r--r--isort/__init__.py4
-rw-r--r--isort/pie_slice.py6
-rw-r--r--runtests.py4
-rw-r--r--setup.cfg8
-rw-r--r--tox.ini4
5 files changed, 18 insertions, 8 deletions
diff --git a/isort/__init__.py b/isort/__init__.py
index 2969988f..6501ebd2 100644
--- a/isort/__init__.py
+++ b/isort/__init__.py
@@ -22,7 +22,7 @@ OTHER DEALINGS IN THE SOFTWARE.
from __future__ import absolute_import, division, print_function, unicode_literals
-from . import settings
-from .isort import SortImports
+from . import settings # noqa: F401
+from .isort import SortImports # noqa: F401
__version__ = "4.2.13"
diff --git a/isort/pie_slice.py b/isort/pie_slice.py
index 2862d3b3..0122a484 100644
--- a/isort/pie_slice.py
+++ b/isort/pie_slice.py
@@ -146,8 +146,8 @@ if PY3:
__all__ = common + ['urllib']
else:
- from itertools import ifilter as filter
- from itertools import imap as map
+ from itertools import ifilter as filter # noqa: F401
+ from itertools import imap as map # noqa: F401
from itertools import izip as zip
from decimal import Decimal, ROUND_HALF_EVEN
@@ -527,7 +527,7 @@ if sys.version_info < (3, 2):
return decorating_function
else:
- from functools import lru_cache
+ from functools import lru_cache # noqa: F401
class OrderedSet(collections.MutableSet):
diff --git a/runtests.py b/runtests.py
index 4109bde0..b699f5e7 100644
--- a/runtests.py
+++ b/runtests.py
@@ -1,5 +1,9 @@
#!/usr/bin/env python
+# Skip linting this file until it's cleaned up:
+# https://github.com/timothycrosley/isort/issues/554
+# flake8: noqa
+
sources = """
eNrcvWmXG1l2INYzY1tjeGYk2ePtg32iQVGIKCKDSXZpyylUqVRFqqmuYvFwUVPOSoGRQGRmNJER
YESAiVSrz/Ev8Dn+Bf4p/mu+29tfAMjqKo3PlNTMTOC9+7b77rv7/T//9e8+/Cx980fr23y+ai7z
diff --git a/setup.cfg b/setup.cfg
index 85548bf5..4ec6f561 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -2,5 +2,11 @@
universal = 1
[flake8]
-ignore = F401,F403,E502,E123,E127,E128,E303,E713,E111,E241,E302,E121,E261,W391
max-line-length = 160
+ignore =
+ # The default ignore list:
+ E121,E123,E126,E226,E24,E704,
+ # Our additions:
+ # E127: continuation line over-indented for visual indent
+ # E128: continuation line under-indented for visual indent
+ E127,E128
diff --git a/tox.ini b/tox.ini
index 97473031..b5996f69 100644
--- a/tox.ini
+++ b/tox.ini
@@ -24,5 +24,5 @@ deps =
[testenv:lint]
basepython = python2.7
-deps = flake8
-commands = flake8 isort setup.py test_isort.py
+deps = flake8==3.3.0
+commands = flake8