My .pylintrc


                    My .pylintrc
   
Created:  Fang lungang 02-27-2007
Modified: Fang lungang 02-27-2007 22:16>
首先,用命令行选项 "—generate-rcfile" 产生一个 .pylintrc 模板。
$ pylint --generate-rcfile > default-pylintrc
$ cp default-pylintrc .pylintrc
然后根据自己偏好、习惯修改这个模板。我最大部分修改都和命名规则有关。默认
的命名规则和我现在用差别太大了,汗。幸好我对正则表达式还算熟悉,哈哈。
下面是 diff -c3 的输出。如果你的命名习惯和我的一样,你可以用 patch 命令
把它打到你的 .pylintrc 上。
*** default-pylintrc        Tue Feb 27 20:11:34 2007
--- .pylintrc        Tue Feb 27 21:10:09 2007
***************
*** 19,25 ****
  ignore=CVS
  # Pickle collected data for later comparisons.
! persistent=yes
  # Set the cache size for astng objects.
  cache-size=500
--- 19,25 ----
  ignore=CVS
  # Pickle collected data for later comparisons.
! persistent=no
  # Set the cache size for astng objects.
  cache-size=500
***************
*** 49,55 ****
  #enable-msg=
  # Disable the message(s) with the given id(s).
! #disable-msg=
  [REPORTS]
--- 49,55 ----
  #enable-msg=
  # Disable the message(s) with the given id(s).
! disable-msg=W0603
  [REPORTS]
***************
*** 59,65 ****
  output-format=text
  # Include message's id in output
! include-ids=no
  # Put messages in a separate file for each module / package specified on the
  # command line instead of printing them on stdout. Reports (if any) will be
--- 59,65 ----
  output-format=text
  # Include message's id in output
! include-ids=yes
  # Put messages in a separate file for each module / package specified on the
  # command line instead of printing them on stdout. Reports (if any) will be
***************
*** 67,73 ****
  files-output=no
  # Tells wether to display a full report or only the messages
! reports=yes
  # Python expression which should return a note less than 10 (10 is the highest
  # note).You have access to the variables errors warning, statement which
--- 67,73 ----
  files-output=no
  # Tells wether to display a full report or only the messages
! reports=no
  # Python expression which should return a note less than 10 (10 is the highest
  # note).You have access to the variables errors warning, statement which
***************
*** 110,122 ****
  module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
  # Regular expression which should only match correct module level names
! const-rgx=(([A-Z_][A-Z1-9_]*)|(__.*__))$
  # 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_]{2,30}$
  # Regular expression which should only match correct method names
  method-rgx=[a-z_][a-z0-9_]{2,30}$
--- 110,122 ----
  module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
  # Regular expression which should only match correct module level names
! const-rgx=(([A-Z][A-Z0-9_]*)|(g_[a-z][A-Za-z0-9_]*)|(__.*__))$
  # 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-Za-z0-9]{2,30}$
  # Regular expression which should only match correct method names
  method-rgx=[a-z_][a-z0-9_]{2,30}$
***************
*** 125,134 ****
  attr-rgx=[a-z_][a-z0-9_]{2,30}$
  # Regular expression which should only match correct argument names
! argument-rgx=[a-z_][a-z0-9_]{2,30}$
  # Regular expression which should only match correct variable names
! variable-rgx=[a-z_][a-z0-9_]{2,30}$
  # Regular expression which should only match correct list comprehension /
  # generator expression variable names
--- 125,134 ----
  attr-rgx=[a-z_][a-z0-9_]{2,30}$
  # Regular expression which should only match correct argument names
! argument-rgx=[a-z][A-Za-z0-9]{2,30}$
  # Regular expression which should only match correct variable names
! variable-rgx=[a-z][A-Za-z0-9]{2,30}$
  # Regular expression which should only match correct list comprehension /
  # generator expression variable names