检查项目中的待办事项
flake8-todos的Python项目详细描述
用于flake8linter检查python源代码中todo注释的插件。
好:
# TODO(jamie): check performance# https://github.com/eclecticiq/flake8-todos/issues/1337
错误:
# FIXME idk how it works lol
为什么?
- 使TODOS具有可操作性和信息性。
- 改进code consistency。
检查
- t001:使用todo而不是fixme(或bug)来保持一致性。
- t002:将author添加到todo(read about motivation here)中。
- t003:将有问题的链接添加到todo中。
- t004:TOdo中缺少冒号。
- t005:TOdo中缺少文本。
- t006:写入todo而不是todo(使用大写)。
安装
python3 -m pip install --user flake8-todos
用法
要检查插件是否已添加到flake8,请运行以下命令:
$ python3 -m flake8 --version 3.7.7 (flake8-todos: 1.0.0, mccabe: 0.6.1, pycodestyle: 2.5.0, pyflakes: 2.1.1) CPython 3.6.7 on Linux
如果在输出中看不到flake8-todos,请检查flake8和flake8-todos是否使用同一个解释器安装。实际上,这意味着两者都需要安装到同一个虚拟环境中。
如果一切正常,运行flake8:
python -m flake8 example.py
配置
flake8docs解释了how to configure flake8。flake8-todos插件使用以字母T开头的代码。请参阅上面的检查以获取完整列表。
许可证
此存储库的内容在3-clause BSD license下发布。 有关详细信息,请参见LICENSE文件。