http://blog.csdn.net/gaoyingju/article/details/50449522 http://flake8.readthedocs.org/en/latest/
条件约定:
OS: CentOS release 6.4 (Final) Python: Python 2.6.6 Flake8: 2.5.1 (pep8: 1.5.7, flake8_quotes: 0.1.1, pyflakes: 1.0.0, flake8-debugger: 1.4.0, flake8-respect-noqa: 0.2, flake8-todo: 0.4, import-order: 0.6.1, flake8-immediate: 0.2, radon: <property object at 0x1dbaec0>, mccabe: 0.3.1, flake8-print: 2.0.1, naming: 0.3.3) CPython 2.6.6 on Linux
开始安装:
pip install flake8 下面的非必须 pip install pep8-naming pip install flake8-import-order pip install flake8-todo pip install flake8-quotes pip install flake8-immediate pip install flake8-debugger pip install radon pip install flake8-print pip install flake8-respect-noqa
使用方式
flake8 filename.py 还有更多姿势等待你发现~
配合git使用:在代码目录下,
flake8 --install-hook git config flake8.strict true
测试结果: 故意写错顺序和代码
赶紧用起来吧,值得你拥有
更多信息请查看官方文档~