Releases: sco1/flake8-annotations
Releases · sco1/flake8-annotations
Release v2.0.0
[v2.0.0]
Changed
- #64 Change prefix from
TYPtoANNin order to deconflict withflake8-typing-imports
Additional Details
Per #64, due to prefix shadowing of TYP between flake8-annotations and flake8-typing-imports, it's been suggested that the prefix for this repository be changed to ANN so the plugins can coexist peacefully.
Release v1.2.0
[v1.2.0]
Added
- Add test case for checking whether flake8 invokes our plugin
- #41 Add
--suppress-none-returningconfiguration option to suppress TYP200 level errors for functions that either lack areturnstatement or only explicitly returnNone. - Add
blackas an explicit developer requirement (codebase already adheres toblackformatting)
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
returnstatement, or - Explicit
returnstatement(s) all returnNone(explicitly or implicitly).
For example:
def foo():
"""This is a test function."""
a = 2 + 2
if a == 4:
return None
else:
returnWill 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:
returnWill 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 functionThe 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
treeargument to the checker so flake8 identifies the plugin as needing to run
Release v1.1.2
[v1.1.2]
Changed
- Request source from
flake8as lines of code rather than parsing it from the requested filename ourselves, allowing for proper parsing ofstdininputs - Remove
flake8-string-formatfrom dev dependencies, asstr.format()isn't used anywhere
Fixed
- #52 Fix error when invoking with
stdinsource code instead of a filename
Release v1.1.1
[v1.1.1]
Added
- Add
pipenv-setupas a dev dependency & CI check to ensure synchronization betweenPipfileandsetup.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_astis now required only for Python versions< 3.8- Update flake8 minimum version to
3.7.9for 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
TYP301classification issue where error is not yielded if the first argument is type annotated and the remaining arguments have type comments