diff options
author | Addison Elliott <addison.elliott@gmail.com> | 2019-01-02 05:55:40 -0600 |
---|---|---|
committer | Ian Stapleton Cordasco <graffatcolmingov@gmail.com> | 2019-01-02 05:55:40 -0600 |
commit | 009f4e7c21890cefafe5858aa682a7e7f17d6a80 (patch) | |
tree | 88d5b66c61e2ddd433a9d3c4183a101181df51aa | |
parent | 066ba4a93c1077f9154d6ff3806fe1e3a66843a1 (diff) | |
download | pyflakes-009f4e7c21890cefafe5858aa682a7e7f17d6a80.tar.gz |
Update TravisCI to use flake8 3.6.0 (#398)
* Bump flake8 versions and fix errors
* Change pep8 to pycodestyle and bump version
* Make changes
* Stick with syntax in tox.ini
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | pyflakes/checker.py | 22 | ||||
-rw-r--r-- | tox.ini | 5 |
3 files changed, 14 insertions, 15 deletions
diff --git a/.travis.yml b/.travis.yml index 2113aec..5d92e4f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,4 +18,4 @@ install: - pip list script: - python setup.py test -q - - if [ "$TRAVIS_PYTHON_VERSION" != "nightly" ]; then pip install flake8==2.1.0 pep8==1.5.6 && flake8 --version && flake8 pyflakes setup.py; fi + - if [ "$TRAVIS_PYTHON_VERSION" != "nightly" ]; then pip install flake8==3.6.0 && flake8 --version && flake8 pyflakes setup.py; fi diff --git a/pyflakes/checker.py b/pyflakes/checker.py index 406b806..a090d8a 100644 --- a/pyflakes/checker.py +++ b/pyflakes/checker.py @@ -10,6 +10,8 @@ import doctest import os import sys +from pyflakes import messages + PY2 = sys.version_info < (3, 0) PY35_PLUS = sys.version_info >= (3, 5) # Python 3.5 and above PY36_PLUS = sys.version_info >= (3, 6) # Python 3.6 and above @@ -21,8 +23,6 @@ except AttributeError: builtin_vars = dir(__import__('__builtin__' if PY2 else 'builtins')) -from pyflakes import messages - if PY2: def getNodeType(node_class): @@ -212,8 +212,8 @@ class VariableKey(object): def __eq__(self, compare): return ( - compare.__class__ == self.__class__ - and compare.name == self.name + compare.__class__ == self.__class__ and + compare.name == self.name ) def __hash__(self): @@ -462,11 +462,11 @@ class FunctionScope(Scope): Return a generator for the assignments which have not been used. """ for name, binding in self.items(): - if (not binding.used - and name != '_' # see issue #202 - and name not in self.globals - and not self.usesLocals - and isinstance(binding, Assignment)): + if (not binding.used and + name != '_' and # see issue #202 + name not in self.globals and + not self.usesLocals and + isinstance(binding, Assignment)): yield name, binding @@ -1225,8 +1225,8 @@ class Checker(object): # Locate the name in locals / function / globals scopes. if isinstance(node.ctx, (ast.Load, ast.AugLoad)): self.handleNodeLoad(node) - if (node.id == 'locals' and isinstance(self.scope, FunctionScope) - and isinstance(node.parent, ast.Call)): + if (node.id == 'locals' and isinstance(self.scope, FunctionScope) and + isinstance(node.parent, ast.Call)): # we are doing locals() call in current scope self.scope.usesLocals = True elif isinstance(node.ctx, (ast.Store, ast.AugStore, ast.Param)): @@ -4,14 +4,13 @@ envlist = py27,py34,py35,py36,py37,pypy,pypy3 [testenv] -deps = +deps = flake8==3.6.0 commands = - pip install flake8==2.1.0 pep8==1.5.6 - flake8 --version python setup.py test -q flake8 pyflakes setup.py [flake8] select = E,F,W +ignore = W504 builtins = unicode max_line_length = 89 |