[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.