美文网首页
python编码规范(pep8, flake8) git配置

python编码规范(pep8, flake8) git配置

作者: 暂时还没有昵称2222 | 来源:发表于2016-01-26 11:59 被阅读406次

开发工具插件

git-hooks(commit前对py文件进行flake8检查)

  • 方法一: 只检查提交的

  • VCS Hooks

    pip --install-hook=git
    git config flake8.strict true
    
  • 方法二: 对目录下的所有文件进行检查

  • 新建 .git/hooks/pre-commit, 内容如下:

    #!/usr/bin/env bash
    flake8 .
    
  • 然后执行:

    chmod +x .git/hooks/pre-commit
    

其他

相关文章

网友评论

      本文标题:python编码规范(pep8, flake8) git配置

      本文链接:https://www.haomeiwen.com/subject/egddkttx.html