| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
* Add support for Python 3.10
* Drop support for EOL Python 2.7 and 3.4-3.5
|
| |
|
| |
|
|
|
|
|
| |
* added functionality to detect typing module attributes with 'import typing as <name>'
* remove async keyword from test_aliased_import
|
| |
|
|
|
| |
Its last release was nearly 10 years ago: https://sourceforge.net/projects/pychecker/files/ , so it seems pretty dead.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
subscript (#609)
|
| |
|
| |
|
|
|
|
| |
TypeVar has such contexts in the positional arguments (for constraints)
and in the `bound` keyword argument.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
| |
Relates #259.
|
| |
|
|
|
| |
Stop allowing failures on Python nightly.
|
|
|
|
|
|
|
| |
* 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
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
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
* Add test case
* Use camel case
|
| |
|
|
|
|
|
|
|
|
|
| |
* 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
* Add another example using a runtime guard for Protocol
|
|
|
|
|
|
|
| |
* Fix test for nightly Python (3.9)
* allow_failures: true for nightly
Co-authored-by: Anthony Sottile <asottile@umich.edu>
|
| |
|
|
|
|
|
| |
* Fix pyflakes for removal of ast.Param
* Remove AugStore / AugLoad (not even used in py2)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
* Support '-V' as an alias for '--version'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
| |
As commented in https://github.com/PyCQA/pyflakes/pull/512#discussion_r392587730
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
| |
They are synonyms and typing_extensions.overloads works on 3.5.1.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|