Extension for flake8 which checks for assignment then return
Project description
no-assignment-and-return
An extension for flake8 which checks for assignment (
=
) thenreturn
in Python
A Flake8 lint based on Clippy's
let_and_return
and Microsoft's TSLint lint
no-unnecessary-local-variable
.
examples
# error
def foo():
x = bar()
return x
# allowed
def foo():
x, _ = bar()
return x
see: flake8_assign_and_return.py
for all the test cases
dev
# install dependencies
poetry install
# install plugin to work with flake8
poetry run python setup.py install
# test
poetry run pytest *.py
# or with watch
poetry run ptw *.py
# typecheck
poetry run mypy .
# format
poetry run black .
# lint
poetry run flake8 .
uploading a new version to PyPi
# build new distribution files
poetry run python setup.py sdist bdist_wheel
# upload to pypi (Note: this will ask for login credentials)
poetry run twine upload dist/*
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for flake8-assign-and-return-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6cd62e2b03b603336ba6e9754c4395525dfbd9652d45dec0ac85e6b7e878d9f4 |
|
MD5 | b5e0819b32591bbf3b7a77230a116a0f |
|
BLAKE2b-256 | 30f602eff276b407da8807fe3cec3cf35cd4d7b64d137d5e860303dc0c94e772 |
Close
Hashes for flake8_assign_and_return-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c69a1477f7dca79f94068f96f63395e00016eca4206143741ea1ac548a99ba30 |
|
MD5 | ca884def3738ead9c5bc6631cb844c44 |
|
BLAKE2b-256 | 605973a96805c2e4021e4c0daf1c8764a43ec669f22db3e5aa765e8b09cc583e |