A flake8 extension that checks for assignment and return in Python
Project description
no-assignment-and-return
A flake8 extension that checks for assignment and return 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
rm -rf dist && 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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c41747116dff5ab9d9f570d67b1c55935917cb44637fa2b516d35bedfad87dd2 |
|
MD5 | 0a51658a65002a668512e0b2dcc9084a |
|
BLAKE2b-256 | 4d9e4507385832175e7358bba8239a862c12008d357cc5c1ed5634344402da86 |
Close
Hashes for flake8_assign_and_return-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1efe9c134c367e50eb1a3ef521da16352e07594c4ebef93c685cc5e2054d5afa |
|
MD5 | 5d04d433fe2868e3730652f39d91a7fe |
|
BLAKE2b-256 | a2255dca7d0d87716ff09e1d8f40eaaf36c039dfa85e3e0fdb3a976ea0404bfc |