summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Drop support for EOL Python 2.7 and 3.4-3.5 (#660)masterHugo van Kemenade2021-12-244-13/+10
| | | | | * Add support for Python 3.10 * Drop support for EOL Python 2.7 and 3.4-3.5
* remove with_statement future imports (#663)Danny Sepler2021-11-213-20/+0
|
* Release 2.4.0 (#657)2.4.0Anthony Sottile2021-10-062-1/+7
|
* Detect typing module attributes with 'import typing as <name>' (#632)Angus L'Herrou2021-10-052-1/+28
| | | | | * added functionality to detect typing module attributes with 'import typing as <name>' * remove async keyword from test_aliased_import
* add support for match statement (#630)Anthony Sottile2021-10-052-1/+96
|
* Remove pychecker from README (#639)Adam Johnson2021-05-281-3/+1
| | | Its last release was nearly 10 years ago: https://sourceforge.net/projects/pychecker/files/ , so it seems pretty dead.
* fix typo: annoation -> annotation (#636)Yusuke Hayashi2021-05-211-1/+1
|
* remove old and unused "tracing" code (#625)Terence Honles2021-05-201-5/+0
|
* fix syntax error offsets for python 3.10 (#635)Anthony Sottile2021-05-203-17/+30
|
* Release 2.3.12.3.1Anthony Sottile2021-03-242-1/+5
|
* Annotations no longer redefine names (#619)Anthony Sottile2021-03-242-0/+12
|
* allow passing tox positional arguments to unittest (#624)Terence Honles2021-03-231-1/+1
|
* Release 2.3.0 (#608)2.3.0Anthony Sottile2021-03-142-1/+13
|
* Fix: Named types incorrectly raising UndefinedName inside annotated ↵Léni2021-03-142-12/+104
| | | | subscript (#609)
* Fix annotation clobbering __all__ (#606)Anthony Sottile2021-01-052-1/+17
|
* deterministic ordering for errors in __all__ (#604)Anthony Sottile2021-01-041-1/+4
|
* Fix quoted type annotations in typing.TypeVar contexts (#534)Ran Benita2021-01-042-0/+28
| | | | TypeVar has such contexts in the positional arguments (for constraints) and in the `bound` keyword argument.
* Test PyPy2/3 on GHA (#598)Hugo van Kemenade2020-12-071-3/+0
|
* Test on GitHub Actions (#596)Hugo van Kemenade2020-12-034-45/+41
| | | | | | | | | | | | | | | | | * Test on GitHub Actions * Add 2.7 and 3.5 to GHA * Remove Travis CI and AppVeyor * Simplify config Co-authored-by: Anthony Sottile <asottile@umich.edu> * Review updates * Remove redundant line Co-authored-by: Anthony Sottile <asottile@umich.edu>
* Recognize __qualname__ when used in class scope (#588)Pilou2020-10-122-1/+22
| | | Relates #259.
* simplify typing.Literal check (#587)Anthony Sottile2020-10-031-6/+2
|
* Fix tests with Python 3.9, closes #549 (#586)Louis Sautier2020-10-022-8/+7
| | | Stop allowing failures on Python nightly.
* Fix test_invalidEscape with recent PyPy3 versions, closes #584 (#585)Louis Sautier2020-10-024-27/+23
| | | | | | | * Fix test_invalidEscape with recent PyPy3 versions, closes #584 * CI: update PyPY version in Travis and AppVeyor Also make it easier to update for AppVeyor.
* fix: don't return syntax error for Annotated's metadata (#580)Sebastian Kreft2020-09-282-9/+71
| | | | | | | | | | | | | | | | | | | | | | | * fix: don't return syntax error for Annotated's metadata PEP 593 https://www.python.org/dev/peps/pep-0593/ introduced the type Annotated, which allows to add metadata to types. By the definition only the first argument is required to be a proper type, all the other arguments are dependent on the consumer and can be other types or even literals. This PR fixes #574. * fix whitespace * fix tests and formatting * PR comments from asottile * fix _in_annotation and remove _in_typing_annotated field * fix test name * get rid of _exit_annotation in favor of _entger_annotation(AnnotationState.None) * handle Annotated in python3.9+ Co-authored-by: Anthony Sottile <asottile@umich.edu>
* Fix undefined name in annotations (#535)Sebastian Rittau2020-09-282-13/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix undefined name in annotations Variable annotations without a value don't create a name, but they still can be used as variable annotation themselves as long as the annotation is quoted or "from __future__ import annotations" is used. The implementation introduces a new binding "Annotation" for these kinds of variable annotations. This can potentially be used for further annotation-related checks in the future. Annotation handling is extended to be able to detect both forms of postponed annotations (quoted and future import) during checks. Fixes #486 * Fix wrong tuple syntax * Refactor annotation handling * Introduce AnnotationState "enum" * Pass AnnotationState to _enter_annotation() instead of a "string" flag * Add a test for unused annotations * Add a few more tests for unused variables
* Extend F822 to support tuple concatenation (#544)jack11422020-09-272-5/+14
| | | | | | | * Extend F822 to support tuple concatenation * Add test case * Use camel case
* update pypy download urls (#581)Anthony Sottile2020-09-271-2/+2
|
* List Python 3.8 support (#541)Brett Cannon2020-05-114-2/+5
| | | | | | | | | * Add Python 3.8 to Travis * Add Python 3.8 to Tox * Add Python 3.8 trove classifier * List Python 3.8 as supported in the README
* Add tests demonstrating common use of TYPE_CHECKING guards (#531)Anthony Sottile2020-04-271-0/+44
| | | | | * Add tests demonstrating common use of TYPE_CHECKING guards * Add another example using a runtime guard for Protocol
* Fix test for nightly Python (3.9) (#532)Petter Strandmark2020-04-262-0/+7
| | | | | | | * Fix test for nightly Python (3.9) * allow_failures: true for nightly Co-authored-by: Anthony Sottile <asottile@umich.edu>
* Release 2.2.02.2.0Anthony Sottile2020-04-092-1/+28
|
* Fix pyflakes for removal of ast.Param (#523)Anthony Sottile2020-03-181-3/+5
| | | | | * Fix pyflakes for removal of ast.Param * Remove AugStore / AugLoad (not even used in py2)
* Be more cautious when identifying typing Literal (#517)Anthony Sottile2020-03-172-1/+22
|
* Fix quoted type annotations in unusual contexts (#516)Peter Law2020-03-172-13/+102
| | | | | | | | | | | | | | | | | | | | * Extract a context manager for when we're in a annotation context * Detect quoted type annotations within typing.cast calls * Refactor typing name check This will make it easier to detect an unspecified typing module member as well as opening up other checks (such as testing for one of a collection many members all in one go). * Detect quoted annotations within subscripts of typing classes * Add nested quoted test case (Callable) * Use a lambda here for clarity This is slightly more usual than accessing a .__eq__ method and is more obviously similar to the other usage of this helper.
* Deprecate optparse in favor of argparse (#499)sim-d2020-03-171-3/+7
| | | | | * Deprecate optparse in favor of argparse * Support '-V' as an alias for '--version'
* Add a check for if statement conditions which are non-empty tuples (#512)Peter Law2020-03-173-2/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add a check for if statement conditions which are non-empty tuples With the increasing prevalence of wrapping conditionals like: if ( some_value != 'some_condition' and other_value is not 42 ) and for wrapping other constructs with trailing commas, like: x = ( some_value, other_value, ) it becomes quite easy to accidentally combine these into a conditional statement which is actually always true: if ( some_value != 'some_condition' and other_value is not 42, ) This commit introduces a check for such constructs. * Make this error message make sense * Further clarity this message's docstring Co-Authored-By: Ran Benita <ran234@gmail.com> Co-authored-by: Ran Benita <ran234@gmail.com>
* Clarify message docstring (#522)Peter Law2020-03-141-1/+1
| | | As commented in https://github.com/PyCQA/pyflakes/pull/512#discussion_r392587730
* Fix bug in async function scope checking (#511)Peter Law2020-03-132-2/+8
| | | | | | | | | | | | | | * Fix bug in async function scope checking Previously attempting to check an async function scoped tree would immediately error because tuples are not callable. The test added here is a direct copy of 'test_scope_function' as I'm not sure what (if anything) should specifically be tested for async functions, though it serves to prove the fix. * Skip async function test where it doesn't apply * Clarify that this is a smoke test for async function segments
* Warn about is comparison to tuple (#484)Anthony Sottile2020-02-173-7/+74
|
* Fix false positive with partially quoted annotations (#479)Anthony Sottile2020-02-142-19/+144
|
* Make pyflakes more resistant to syntax additions (#490)Anthony Sottile2020-02-072-1/+20
|
* Fix annotation of posonlyarg (#508)Anthony Sottile2020-01-172-0/+12
|
* Allow continue inside finally in 3.8+ (#476)Batuhan Taşkaya2019-11-032-1/+4
|
* fix test name typo (#478)Florian Dahlitz2019-10-051-1/+1
|
* Allow @overload on async functions as well (#472)Anthony Sottile2019-09-302-1/+21
|
* Support typing_extensions.overload in addition to typing.overload (#466)Michael J. Sullivan2019-09-282-1/+20
| | | They are synonyms and typing_extensions.overloads works on 3.5.1.
* Adjust tests for different SyntaxError offsets for pypy7.1.1 (#468)Anthony Sottile2019-09-284-36/+49
|
* Remove unnecessary `else` (#439)Steven Myint2019-08-121-2/+2
|
* Add support for PEP 572 assignment expressions (#457)Anthony Sottile2019-08-122-1/+10
|
* In PEP 484 type comments, allow text after "# type: ignore" (#455)Michael J. Sullivan2019-08-123-5/+28
| | | | | | | | | | | | | | | | * In PEP 484 type comments, allow text after "# type: ignore" This is to support allowing typecheckers to implement ignores for specific errors, using syntax like `# type: ignore=E1000` or `# type: ignore[type-mismatch` or some such. mypy is about to add support for ignoring specific errors following this design: https://github.com/python/mypy/issues/7239 Support for extra text in type comments was implemented in CPython as https://bugs.python.org/issue36878 and in typed_ast as https://github.com/python/typed_ast/pull/116. * add test back