| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
https://docs.python.org/3.6/whatsnew/3.5.html#pep-465-a-dedicated-infix-operator-for-matrix-multiplication
This fixes https://bugs.launchpad.net/pyflakes/+bug/1523163.
|
|
|
|
|
| |
As '*' does not appear in __future__.all_feature_names, this
also reports an error on : from __future__ import *
|
|
|
|
|
| |
Replaces plain attribute Checker.futuresAllowed with a property
that supports __future__ in both module and doctest.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Explicitly place the doctest directly under the module scope,
instead of processing it while within the scope where the
docstring was encountered.
Also do not process doctest which are not processed by default
according to the doctest documentation.
The primary benefit of moving the doctest scope directly under
the module scope is that it may be efficiently identified,
as it may only appear second in the stack.
However it also ensures that the doctest scope can not access
names in scopes between the module scope and the object where the
docstring was encountered. As it was, class scope rules prevented
the doctest scope from accessing names in a class scope, however
the doctest scope was able to access names in an outer function,
if the doctest appeared in a nested function.
Note that there was no real bug there, as the doctest module does
not process doctest in nested functions (Python issue #1650090),
so doctest appearing in nested functions are informational only.
pyflakes previously inspected doctest in nested functions,
and now these are ignored.
|
|
|
|
| |
Also detect unused star imports.
|
|\
| |
| | |
Report assert using tuple
|
|/
|
|
|
|
| |
This is a SyntaxWarning on Python 2.6+
Resolves lp:848467
|
|
|
|
|
| |
8c8a27b8 provided a partial solution for generators in the class scope,
however it did not account for generators enclosing other generators.
|
| |
|
| |
|
|
|
|
|
|
| |
The test_doubleNestingReportsClosestName in test_doctest only
differs by the expected line number of the error, which can
be dynamically determined using TestCase.withDoctest.
|
|
|
|
|
|
| |
An import in a class is a member of the class,
and may be used outside the class scope, so it
can not be marked as unused.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This includes return and yield outside of a function and break and
continue outside of a loop. Fixes lp 1293654.
The problem is that these SyntaxErrors are not encoded in the ast
grammar, so they are not detected when just compiling to ast. You must
compile down to bytecode to catch them. The advantage here is that we
can still check for other kinds of errors in this case, because the ast
is still valid.
|
|
|
|
|
|
|
| |
Fix bug in 03ffc76 caused by determining the doctest global scope level
based on whether parsing doctests was enabled.
Also do not parse docstrings within doctests.
|
|
|
|
|
|
|
| |
03ffc763 introduced better global support,
however a logic error caused it to remove any
previously detected UndefinedName whenever
a global was encountered.
|
|
|
|
|
| |
PEP 498 f-strings cause pyflakes to crash with
AttributeError: 'Checker' object has no attribute 'FORMATTEDVALUE'
|
|
|
|
|
| |
ef4da24 changed the Binding.used tuple from (scope, line number)
to (scope, node). This updates the docstring to reflect this change.
|
|\
| |
| | |
Fix typos
|
| | |
|
|\ \
| | |
| | | |
fix typo in readme
|
|/ / |
|
| |
| |
| |
| |
| | |
Also declare Python 3.5 as supported in the README. We test 3.5 in CI
now, and since 0.9.2 support for 3.5's new features have been added.
|
|\ \
| |/
|/| |
Enable Python 3.5 on Travis CI
|
|/ |
|
|\
| |
| | |
Fix test_api.py on Windows
|
| | |
|
|/ |
|
| |
|
|\
| |
| | |
Don't report UnusedImport when binding global name
|
| |
| |
| |
| |
| | |
When an import binds to a name declared global by the "global"
statment, don't report it as unused.
|
|/ |
|
|\
| |
| |
| |
| |
| |
| | |
Add tests to document hard to test cases
It would be nice if shadowing an unused variable was an error, but this
is quite difficult to implement in a way which does not also raise false
positives in the context of loops.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
Shadowing a used variable should still potentially raise an
UnusedVariable warning. Alter tests' expected results to agree with
this premise.
|
|\ \
| |/
|/| |
Avoid running flake8 under nightly
|
|/
|
|
| |
PyPI's pep8 is not compatible with Python 3.5 yet.
|
|\
| |
| | |
Test "nightly" version of Python
|
|/
|
| |
This allows us to test the Python 3.5 related changes I made previously.
|
| |
|
| |
|
|
|
|
| |
The Binding.used property must be a tuple (unless it's False).
|
|\
| |
| |
| |
| | |
Conflicts:
pyflakes/__init__.py
|
| | |
|
|/ |
|
| |
|
|
|
|
|
|
| |
This allows Travis to use the Docker container infrastructure, which should
make builds start up faster. See
http://docs.travis-ci.com/user/workers/container-based-infrastructure/
|
|
|
|
|
| |
Add declared globals to each scope in the scope stack to avoid
erroneous UndefinedName errors when they are loaded.
|
|
|
|
|
|
|
|
| |
Depending on the C library, some constants (like signal.SIGINT) might
not be defined. The previous code attempted to avoid failures on invalid
signals by catching the ValueError raised by signal.signal when given an
invalid signal to handle, however failed to account for the possiblity
of the signal not being defined at all.
|