一个检查Python中赋值和返回的flake8扩展
项目描述
no-assignment-and-return

一个检查Python中赋值和返回的flake8扩展
基于Clippy的 let_and_return
和Microsoft的TSLint lint no-unnecessary-local-variable
的Flake8 lint。
有关此lint结构的更多信息,请参阅随附的博客文章。
示例
# error
def foo():
x = bar()
return x
# allowed
def foo():
x, _ = bar()
return x
查看: flake8_assign_and_return.py
中的所有测试用例
开发
# install dependencies
poetry install
# install plugin to work with flake8
poetry run python setup.py install
# test
poetry run pytest
# or with watch
poetry run ptw
# typecheck
poetry run mypy *.py
# format
poetry run black .
# lint
poetry run flake8 .
将新版本上传到 PyPi
# increment `__version__` and pyproject.toml `version`
# 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/*
项目详情
关闭
flake8-assign-and-return-0.0.4.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | ffd1cc6c21b0a786c44b445d188b646b3f17b33c2fe49649a5bd2ff735610721 |
|
MD5 | 0619c48d592c47fadcdc6a63dbc1bcf0 |
|
BLAKE2b-256 | 119d9ae41189edfd9758b96e46d8a3c53aa2348c35992ced6ef4d87cfac00fb7 |
关闭
flake8_assign_and_return-0.0.4-py3-none-any.whl的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 959fbcad1737cb68d4be96547a40d9b15e6501a29286b37509b9e73f3d387002 |
|
MD5 | 4adae8ea9c09f29c83da521e5aea6d41 |
|
BLAKE2b-256 | b9027797c07976e548d65fe4aeaf32074f10603258a519fb9c61ea517021ac6e |