在python中检查赋值和返回的flake8扩展
flake8-assign-and-return的Python项目详细描述
不赋值并返回
A flake8 extension that checks for assignment and return in Python
根据克里比的
^{
有关此lint结构的更多信息,请参见accompanying blog post。
示例
# errordeffoo():x=bar()returnx# alloweddeffoo():x,_=bar()returnx
有关所有测试用例,请参见: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/*