使用git-pylint-commit-hook工具

pre-commit脚本

配置文件放在仓库根目录/hooks下面

git-pylint-commit-hook --limit=9.0 --pylintrc=hooks/.pylintrc

配置

[BASIC]
# Regular expression which should only match correct module names
module-rgx=([a-z][a-z0-9_]*)$ attr-rgx=[a-z_][a-z0-9_]{,30} # Regular expression which should only match correct class names
class-rgx=[A-Z_]+[a-zA-Z0-9]+$ # Regular expression which should only match correct function names
function-rgx=[a-z_]+[a-z0-9_][a-z0-9]*$ # Regular expression which should only match correct method names
# Allow upper cases in testFeatureSelection where FeatureSelection
# is a class name
method-rgx=(([a-z_]|__)[a-z0-9_]*(__)?|test[a-zA-Z0-9_]*)$ # Regular expression which should only match correct argument names
argument-rgx=[a-z][a-z0-9]*_*[a-z0-9]*_*[a-z0-9]*_?$ # Regular expression which should only match correct variable names
variable-rgx=([a-z_]+[a-z0-9]*_*[a-z0-9]*_*[a-z0-9]*_?||(__[a-zA-Z0-9_]*__))$||[A-Z]+ # Regular expression which should only match correct module level names
# Default: (([A-Z_][A-Z1-9_]*)|(__.*__))$
const-rgx=([a-z_]+[a-z0-9]*_*[a-z0-9]*_*[a-z0-9]*_?|__[a-zA-Z0-9_]*__)$||[A-Z]+ [FORMAT]
indent-string=' ' [DESIGN] # We are capable to follow that many, yes!
max-branchs = 20 # some base class constructors have quite a few arguments
max-args = 14 # and due to ClassWithCollections and conditional attributes classes by default have lots
# of attributes
max-attributes = 14 # some sci computation can't be handled efficiently without having
#lots of locals
max-locals = 35 [MESSAGES CONTROL]
# Disable the following PyLint messages:
# R0903 - Not enough public methods
# W0105 - String statement has no effect # often used for after-line doc
# W0142 - Used * or ** magic
# W0232 - Class has no __init__ method
# W0212 - Access to a protected member ... of a client class
# W0613 - Unused argument
# E1101 - Has no member (countless false-positives)
# R0904 - Too many public methods
disable-msg=R0903,W0142,W0105,W0212,W0613,E1101,R0904
disable=import-error,unused-import [REPORTS] # set the output format. Available formats are text, parseable, colorized and
# html
output-format=parseable # Include message's id in output
include-ids=yes # Tells wether to display a full report or only the messages
# reports=no [MISCELLANEOUS] # List of note tags to take in consideration, separated by a comma.
# FIXME -- something which needs fixing
# TODO -- future plan
# XXX -- some concern
# YYY -- comment/answer to above mentioned concern
notes=FIXME,TODO,XXX,YYY [MASTER]
ignore=tests
disable-msg=R0904,R0903,E1101,R21

最新文章

  1. MATLAB的PLOT函数线型设置及横坐标为字符串的代码实例
  2. js读取解析JSON数据
  3. Unichar, char, wchar_t
  4. Delphi ServerSocket,ClientSocket示例
  5. 2014年全球SEO行业调查报告
  6. Java空字符串与null的区别和判断字符串是否为空的方法
  7. gulp安装
  8. vijos1022题解
  9. Django Channels 入门指南
  10. 到底什么时候该使用MQ?
  11. mysql5.7版本tar包手动安装---redhat7.0
  12. 【Ruby】【环境搭建】macOS Sierra 10.12.6 + Xcode 8 + gpg 2.2.8 + rvm 1.29.3 + Ruby 2.4.0 + RubyMine 2018.1.4
  13. Objective-C 代码混淆
  14. Java连接访问Oracle--Connection.setSavepoint()方法使用
  15. logstash retrying failed action with response code: 429
  16. JQuery EasyUI combobox 省市两级联动
  17. pop to 特定的UIViewController
  18. Android自定义控件实战——仿淘宝商品浏览界面
  19. /i,/m,/s,/x,/A,/s,/U,/x,/j,/u 等正则修饰符用法~
  20. mysql主键问题

热门文章

  1. First Linux Centos 7.2 rpm 安装MySQL 5.7
  2. Java安全之 ClassLoader类加载器
  3. [USACO10NOV]Buying Feed G
  4. WCF服务调用超时错误:套接字连接已中止。这可能是由于处理消息时出错或远程主机超过接收超时或者潜在的网络资源问题导致的。本地套接字超时是“00:05:30”(已解决)
  5. Spring配置文件结构对于生成Bean的影响
  6. Spatial Analyst Tools(Spatial Analyst 工具)
  7. linux性能优化基础——iommu相关配置
  8. SpringBoot打包到docker(idea+传统方式)
  9. Apache Zookeeper Java客户端Curator使用及权限模式详解
  10. Elasticsearch 中为什么选择倒排索引而不选择 B 树索引