scripts/pylint/pylintrc
changeset 388 699b206b64b7
child 833 1b9604b95eeb
equal deleted inserted replaced
387:c55195361cb6 388:699b206b64b7
       
     1 # This is a configuration file for pylint to be used for checking the
       
     2 # quality of the Melange code
       
     3 # 
       
     4 # just run:
       
     5 #   scripts/pylint/do_pylint.sh
       
     6 
       
     7 [MASTER]
       
     8 
       
     9 # Profiled execution.
       
    10 profile=no
       
    11 
       
    12 # Add <file or directory> to the black list. It should be a base name, not a
       
    13 # path. You may set this option multiple times.
       
    14 ignore=.svn
       
    15 
       
    16 # Pickle collected data for later comparisons.
       
    17 persistent=yes
       
    18 
       
    19 # Set the cache size for astng objects.
       
    20 cache-size=500
       
    21 
       
    22 # List of plugins (as comma separated values of python modules names) to load,
       
    23 # usually to register additional checkers.
       
    24 load-plugins=
       
    25 
       
    26 
       
    27 [MESSAGES CONTROL]
       
    28 
       
    29 # Enable only checker(s) with the given id(s). This option conflicts with the
       
    30 # disable-checker option
       
    31 #enable-checker=
       
    32 
       
    33 # Enable all checker(s) except those with the given id(s). This option
       
    34 # conflicts with the enable-checker option
       
    35 disable-checker=design
       
    36 
       
    37 # Enable all messages in the listed categories.
       
    38 #enable-msg-cat=
       
    39 
       
    40 # Disable all messages in the listed categories.
       
    41 #disable-msg-cat=
       
    42 
       
    43 # Enable the message(s) with the given id(s).
       
    44 #enable-msg=
       
    45 
       
    46 
       
    47 # Disable the message(s) with the given id(s).
       
    48 # List of all available ids: http://www.logilab.org/card/pylintfeatures
       
    49 # Potential messages that might be added later include:
       
    50 # C0302,R0201
       
    51 
       
    52 # Disabled messages:
       
    53 # W0613: Unused argument %r Used when a function or method argument is not used.
       
    54 # W0622: Redefining built-in %r Used when a variable or function override a built-in.
       
    55 # W0232: Class has no __init__ method Used when a class has no __init__ method, neither 
       
    56 #        its parent classes.
       
    57 # W0142: Used * or * magic* Used when a function or method is called using *args or **kwargs
       
    58 #        to dispatch arguments. This doesn't improve readility and should be used with care.
       
    59 # W0102: Dangerous default value %s as argument Used when a mutable value as list or dictionary 
       
    60 #        is detected in a default value for an argument.
       
    61 # W0212: Access to a protected member %s of a client class Used when a protected member 
       
    62 #        (i.e. class member with a name beginning with an underscore) is access outside the class 
       
    63 #        or a descendant of the class where it's defined.
       
    64 disable-msg=W0613,W0622,W0232,W0142,W0102,W0212
       
    65 
       
    66 
       
    67 [REPORTS]
       
    68 
       
    69 # set the output format. Available formats are text, parseable, colorized, msvs
       
    70 # (visual studio) and html
       
    71 output-format=text
       
    72 
       
    73 # Include message's id in output
       
    74 include-ids=yes
       
    75 
       
    76 # Put messages in a separate file for each module / package specified on the
       
    77 # command line instead of printing them on stdout. Reports (if any) will be
       
    78 # written in a file name "pylint_global.[txt|html]".
       
    79 files-output=no
       
    80 
       
    81 # Tells wether to display a full report or only the messages
       
    82 reports=yes
       
    83 
       
    84 # Python expression which should return a note less than 10 (10 is the highest
       
    85 # note).You have access to the variables errors warning, statement which
       
    86 # respectivly contain the number of errors / warnings messages and the total
       
    87 # number of statements analyzed. This is used by the global evaluation report
       
    88 # (R0004).
       
    89 evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
       
    90 
       
    91 # Add a comment according to your evaluation note. This is used by the global
       
    92 # evaluation report (R0004).
       
    93 comment=no
       
    94 
       
    95 # Enable the report(s) with the given id(s).
       
    96 #enable-report=
       
    97 
       
    98 # Disable the report(s) with the given id(s).
       
    99 #disable-report=
       
   100 
       
   101 
       
   102 # checks for :
       
   103 # * doc strings
       
   104 # * modules / classes / functions / methods / arguments / variables name
       
   105 # * number of arguments, local variables, branchs, returns and statements in
       
   106 # functions, methods
       
   107 # * required module attributes
       
   108 # * dangerous default values as arguments
       
   109 # * redefinition of function / method / class
       
   110 # * uses of the global statement
       
   111 # 
       
   112 [BASIC]
       
   113 
       
   114 # Required attributes for module, separated by a comma
       
   115 required-attributes=
       
   116 
       
   117 # Regular expression which should only match functions or classes name which do
       
   118 # not require a docstring
       
   119 no-docstring-rgx=__.*__
       
   120 
       
   121 # Regular expression which should only match correct module names
       
   122 module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
       
   123 
       
   124 # Regular expression which should only match correct module level names
       
   125 const-rgx=(([A-Z_][A-Z1-9_]*)|(__.*__)|([a-z_][a-z0-9_]*))$
       
   126 
       
   127 # Regular expression which should only match correct class names
       
   128 class-rgx=[A-Z_][a-zA-Z0-9]+$
       
   129 
       
   130 # Regular expression which should only match correct function names
       
   131 function-rgx=[a-z_][a-zA-Z0-9_]{2,30}$
       
   132 
       
   133 # Regular expression which should only match correct method names
       
   134 method-rgx=[a-z_][a-zA-Z0-9_]{2,30}$
       
   135 
       
   136 # Regular expression which should only match correct instance attribute names
       
   137 attr-rgx=[a-z_][a-z0-9_]{2,30}$
       
   138 #alternative
       
   139 #attr-rgx=([a-z_][a-z0-9_]{2,30}|([a-z_][a-zA-Z0-9]{2,30}))$
       
   140 
       
   141 # Regular expression which should only match correct argument names
       
   142 argument-rgx=[a-z_][a-z0-9_]{1,30}$
       
   143 
       
   144 # Regular expression which should only match correct variable names
       
   145 variable-rgx=[a-z_][a-zA-Z0-9_]{1,30}$
       
   146 
       
   147 # Regular expression which should only match correct list comprehension /
       
   148 # generator expression variable names
       
   149 inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
       
   150 
       
   151 # Good variable names which should always be accepted, separated by a comma
       
   152 good-names=i,j,k,ex,Run,_
       
   153 
       
   154 # Bad variable names which should always be refused, separated by a comma
       
   155 bad-names=foo,bar,baz,toto,tutu,tata
       
   156 
       
   157 # List of builtins function names that should not be used, separated by a comma
       
   158 bad-functions=map,filter,apply,input
       
   159 
       
   160 
       
   161 # try to find bugs in the code using type inference
       
   162 # 
       
   163 [TYPECHECK]
       
   164 
       
   165 # Tells wether missing members accessed in mixin class should be ignored. A
       
   166 # mixin class is detected if its name ends with "mixin" (case insensitive).
       
   167 ignore-mixin-members=yes
       
   168 
       
   169 # List of classes names for which member attributes should not be checked
       
   170 # (useful for classes with attributes dynamicaly set).
       
   171 ignored-classes=SQLObject
       
   172 
       
   173 # When zope mode is activated, consider the acquired-members option to ignore
       
   174 # access to some undefined attributes.
       
   175 zope=no
       
   176 
       
   177 # List of members which are usually get through zope's acquisition mecanism and
       
   178 # so shouldn't trigger E0201 when accessed (need zope=yes to be considered).
       
   179 acquired-members=REQUEST,acl_users,aq_parent
       
   180 
       
   181 
       
   182 # checks for
       
   183 # * unused variables / imports
       
   184 # * undefined variables
       
   185 # * redefinition of variable from builtins or from an outer scope
       
   186 # * use of variable before assigment
       
   187 # 
       
   188 [VARIABLES]
       
   189 
       
   190 # Tells wether we should check for unused import in __init__ files.
       
   191 init-import=no
       
   192 
       
   193 # A regular expression matching names used for dummy variables (i.e. not used).
       
   194 dummy-variables-rgx=_|dummy
       
   195 
       
   196 # List of additional names supposed to be defined in builtins. Remember that
       
   197 # you should avoid to define new builtins when possible.
       
   198 additional-builtins=
       
   199 
       
   200 
       
   201 # checks for :
       
   202 # * methods without self as first argument
       
   203 # * overridden methods signature
       
   204 # * access only to existant members via self
       
   205 # * attributes not defined in the __init__ method
       
   206 # * supported interfaces implementation
       
   207 # * unreachable code
       
   208 # 
       
   209 [CLASSES]
       
   210 
       
   211 # List of interface methods to ignore, separated by a comma. This is used for
       
   212 # instance to not check methods defines in Zope's Interface base class.
       
   213 ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
       
   214 
       
   215 # List of method names used to declare (i.e. assign) instance attributes.
       
   216 defining-attr-methods=__init__,__new__,setUp
       
   217 
       
   218 
       
   219 # checks for
       
   220 # * external modules dependencies
       
   221 # * relative / wildcard imports
       
   222 # * cyclic imports
       
   223 # * uses of deprecated modules
       
   224 # 
       
   225 [IMPORTS]
       
   226 
       
   227 # Deprecated modules which should not be used, separated by a comma
       
   228 deprecated-modules=regsub,string,TERMIOS,Bastion,rexec
       
   229 
       
   230 # Create a graph of every (i.e. internal and external) dependencies in the
       
   231 # given file (report R0402 must not be disabled)
       
   232 import-graph=
       
   233 
       
   234 # Create a graph of external dependencies in the given file (report R0402 must
       
   235 # not be disabled)
       
   236 ext-import-graph=
       
   237 
       
   238 # Create a graph of internal dependencies in the given file (report R0402 must
       
   239 # not be disabled)
       
   240 int-import-graph=
       
   241 
       
   242 
       
   243 # checks for :
       
   244 # * unauthorized constructions
       
   245 # * strict indentation
       
   246 # * line length
       
   247 # * use of <> instead of !=
       
   248 # 
       
   249 [FORMAT]
       
   250 
       
   251 # Maximum number of characters on a single line.
       
   252 max-line-length=80
       
   253 
       
   254 # Maximum number of lines in a module
       
   255 max-module-lines=1000
       
   256 
       
   257 # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
       
   258 # tab).
       
   259 indent-string='  '
       
   260 
       
   261 
       
   262 # checks for:
       
   263 # * warning notes in the code like TODO
       
   264 # * PEP 263: source code with non ascii character but no encoding declaration
       
   265 # 
       
   266 [MISCELLANEOUS]
       
   267 
       
   268 # List of note tags to take in consideration, separated by a comma.
       
   269 notes=TODO
       
   270 
       
   271 
       
   272 # checks for similarities and duplicated code. This computation may be
       
   273 # memory / CPU intensive, so you should disable it if you experiments some
       
   274 # problems.
       
   275 # 
       
   276 [SIMILARITIES]
       
   277 
       
   278 # Minimum lines number of a similarity.
       
   279 min-similarity-lines=4
       
   280 
       
   281 # Ignore comments when computing similarities.
       
   282 ignore-comments=yes
       
   283 
       
   284 # Ignore docstrings when computing similarities.
       
   285 ignore-docstrings=yes