Releases: sco1/flake8-annotations
Releases · sco1/flake8-annotations
Release v1.2.0
[v1.2.0]
Added
- Add test case for checking whether flake8 invokes our plugin
- #41 Add
--suppress-none-returning
configuration option to suppress TYP200 level errors for functions that either lack areturn
statement or only explicitly returnNone
. - Add
black
as an explicit developer requirement (codebase already adheres toblack
formatting)
Changed
- #61 Migrate from Pipenv to Poetry for developer environment setup
Additional Details:
This release adds the --suppress-none-returning
configuration option, as requested by #41. If this flag is set, TYP200
-level errors are suppressed for functions that meet one of the following criteria:
- Contain no
return
statement, or - Explicit
return
statement(s) all returnNone
(explicitly or implicitly).
For example:
def foo():
"""This is a test function."""
a = 2 + 2
if a == 4:
return None
else:
return
Will not yield a TYP201
error, with the flag set:
$ flake8 test.py
test.py:1:11: TYP201 Missing return type annotation for public function
$ flake8 test.py --suppress-none-returning
<No output>
And:
def foo():
"""This is a test function."""
a = 2 + 2
if a == 4:
return True
else:
return
Will still yield a TYP201
error, with the flag set:
$ flake8 test.py
test.py:1:11: TYP201 Missing return type annotation for public function
$ flake8 test.py --suppress-none-returning
test.py:1:11: TYP201 Missing return type annotation for public function
The default value of this configuration option is False
, so this addition should be transparent to existing users.
Release v1.1.3
[v1.1.3]
Fixed
- Add missing classifier test cases for POSONLYARGS
- Re-add the
tree
argument to the checker so flake8 identifies the plugin as needing to run
Release v1.1.2
[v1.1.2]
Changed
- Request source from
flake8
as lines of code rather than parsing it from the requested filename ourselves, allowing for proper parsing ofstdin
inputs - Remove
flake8-string-format
from dev dependencies, asstr.format()
isn't used anywhere
Fixed
- #52 Fix error when invoking with
stdin
source code instead of a filename
Release v1.1.1
[v1.1.1]
Added
- Add
pipenv-setup
as a dev dependency & CI check to ensure synchronization betweenPipfile
andsetup.py
- Add tox configuration for local testing across Python versions
- Add test for checking a single yield of TYP301 per function
- Add coverage reporting to test suite
- Add testing for positional only arguments
Changed
typed_ast
is now required only for Python versions< 3.8
- Update flake8 minimum version to
3.7.9
for Python 3.8 compatibility - #50 Completely refactor test suite for maintainability
Fixed
- Fix mixed type hint tests not being run due to misnamed test class
- Fix
TYP301
classification issue where error is not yielded if the first argument is type annotated and the remaining arguments have type comments