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 Distributions
Close
Hashes for flake8-assign-and-return-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ba8c48b364bd5b3376cee87945f70a717ee7bc08c57c336193e6842fc060fc3 |
|
MD5 | 773f9c65d9fa72193b3834ba57c8e523 |
|
BLAKE2b-256 | c0e77c591a822138c50c6366f6bbe15b20f2d8fb6d09c3e9b8acdba5edf58244 |
Close
Hashes for flake8_assign_and_return-0.0.1-py3.6.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca22963e8630fab5c415d59e65cc372399c8d98dcb27883b8b034f33a5ce16a0 |
|
MD5 | 94d1e9705eda29a71195a5e1508a2a6b |
|
BLAKE2b-256 | 5e33aa12915ff9099a18bd2f492a9d04cd31ba41a152393d72d32d3874503a6d |
Close
Hashes for flake8_assign_and_return-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d22d4e61f1d25a465f2022a9dffa1861c1966e7099ea8bde51a7fa95d8534f7 |
|
MD5 | 631470d97dea479d33e1473e513b0a53 |
|
BLAKE2b-256 | 8a643464ba11c8f50b519aa74ca6c49fe4530c390dd124c385ab421d408a5d19 |