1# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 2# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt 3 4# lint Python modules using external checkers. 5# 6# This is the main checker controlling the other ones and the reports 7# generation. It is itself both a raw checker and an astng checker in order 8# to: 9# * handle message activation / deactivation at the module level 10# * handle some basic but necessary stats'data (number of classes, methods...) 11# 12[MASTER] 13 14# Specify a configuration file. 15#rcfile= 16 17# Python code to execute, usually for sys.path manipulation such as 18# pygtk.require(). 19#init-hook= 20 21# Add <file or directory> to the black list. It should be a base name, not a 22# path. You may set this option multiple times. 23ignore= 24 25# Pickle collected data for later comparisons. 26persistent=no 27 28# Set the cache size for astng objects. 29cache-size=500 30 31# List of plugins (as comma separated values of python modules names) to load, 32# usually to register additional checkers. 33load-plugins= 34 35extension-pkg-whitelist= 36 greenlet 37 38[MESSAGES CONTROL] 39 40# Enable only checker(s) with the given id(s). This option conflicts with the 41# disable-checker option 42#enable-checker= 43 44# Enable all checker(s) except those with the given id(s). This option 45# conflicts with the enable-checker option 46#disable-checker= 47 48# Enable all messages in the listed categories. 49#enable-msg-cat= 50 51# Disable all messages in the listed categories. 52#disable-msg-cat= 53 54# Enable the message(s) with the given id(s). 55enable= 56 useless-suppression 57 58# Disable the message(s) with the given id(s). 59disable= 60 spelling, 61# Messages that are just silly: 62 locally-disabled, 63 exec-used, 64 no-init, 65 bad-whitespace, 66 global-statement, 67 broad-except, 68 no-else-return, 69# Messages that may be silly: 70 no-self-use, 71 no-member, 72 using-constant-test, 73 too-many-nested-blocks, 74 too-many-ancestors, 75 unnecessary-pass, 76 no-else-break, 77 no-else-continue, 78# Questionable things, but it's ok, I don't need to be told: 79 import-outside-toplevel, 80 self-assigning-variable, 81# Formatting stuff 82 superfluous-parens, 83 bad-continuation, 84# Disable while we still support Python 2: 85 useless-object-inheritance, 86# Messages that are noisy for now, eventually maybe we'll turn them on: 87 invalid-name, 88 protected-access, 89 duplicate-code, 90 cyclic-import 91 92msg-template={path}:{line}: {msg} ({symbol}) 93 94[REPORTS] 95 96# set the output format. Available formats are text, parseable, colorized, msvs 97# (visual studio) and html 98output-format=text 99 100# Put messages in a separate file for each module / package specified on the 101# command line instead of printing them on stdout. Reports (if any) will be 102# written in a file name "pylint_global.[txt|html]". 103files-output=no 104 105# Tells wether to display a full report or only the messages 106reports=no 107 108# I don't need a score, thanks. 109score=no 110 111# Python expression which should return a note less than 10 (10 is the highest 112# note).You have access to the variables errors warning, statement which 113# respectively contain the number of errors / warnings messages and the total 114# number of statements analyzed. This is used by the global evaluation report 115# (R0004). 116evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) 117 118# Enable the report(s) with the given id(s). 119#enable-report= 120 121# Disable the report(s) with the given id(s). 122#disable-report= 123 124 125# checks for : 126# * doc strings 127# * modules / classes / functions / methods / arguments / variables name 128# * number of arguments, local variables, branchs, returns and statements in 129# functions, methods 130# * required module attributes 131# * dangerous default values as arguments 132# * redefinition of function / method / class 133# * uses of the global statement 134# 135[BASIC] 136 137# Regular expression which should only match functions or classes name which do 138# not require a docstring 139# Special methods don't: __foo__ 140# Test methods don't: testXXXX 141# TestCase overrides don't: setUp, tearDown 142# Nested decorator implementations: _decorator, _wrapper 143# Dispatched methods don't: _xxx__Xxxx 144no-docstring-rgx=__.*__|test[A-Z_].*|setUp|tearDown|_decorator|_wrapper|_.*__.* 145 146# Regular expression which should only match correct module names 147module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ 148 149# Regular expression which should only match correct module level names 150const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ 151 152# Regular expression which should only match correct class names 153class-rgx=[A-Z_][a-zA-Z0-9]+$ 154 155# Regular expression which should only match correct function names 156function-rgx=[a-z_][a-z0-9_]{2,30}$ 157 158# Regular expression which should only match correct method names 159method-rgx=[a-z_][a-z0-9_]{2,30}$|setUp|tearDown|test_.* 160 161# Regular expression which should only match correct instance attribute names 162attr-rgx=[a-z_][a-z0-9_]{2,30}$ 163 164# Regular expression which should only match correct argument names 165argument-rgx=[a-z_][a-z0-9_]{2,30}$ 166 167# Regular expression which should only match correct variable names 168variable-rgx=[a-z_][a-z0-9_]{2,30}$ 169 170# Regular expression which should only match correct list comprehension / 171# generator expression variable names 172inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ 173 174# Good variable names which should always be accepted, separated by a comma 175good-names=i,j,k,ex,Run,_ 176 177# Bad variable names which should always be refused, separated by a comma 178bad-names=foo,bar,baz,toto,tutu,tata 179 180# List of builtins function names that should not be used, separated by a comma 181bad-functions= 182 183 184# try to find bugs in the code using type inference 185# 186[TYPECHECK] 187 188# Tells wether missing members accessed in mixin class should be ignored. A 189# mixin class is detected if its name ends with "mixin" (case insensitive). 190ignore-mixin-members=yes 191 192# List of classes names for which member attributes should not be checked 193# (useful for classes with attributes dynamicaly set). 194ignored-classes=SQLObject 195 196# List of members which are usually get through zope's acquisition mecanism and 197# so shouldn't trigger E0201 when accessed (need zope=yes to be considered). 198acquired-members=REQUEST,acl_users,aq_parent 199 200 201# checks for 202# * unused variables / imports 203# * undefined variables 204# * redefinition of variable from builtins or from an outer scope 205# * use of variable before assigment 206# 207[VARIABLES] 208 209# Tells wether we should check for unused import in __init__ files. 210init-import=no 211 212# A regular expression matching names of unused arguments. 213ignored-argument-names=_|unused|.*_unused 214dummy-variables-rgx=_|unused|.*_unused 215 216# List of additional names supposed to be defined in builtins. Remember that 217# you should avoid to define new builtins when possible. 218additional-builtins= 219 220 221# checks for : 222# * methods without self as first argument 223# * overridden methods signature 224# * access only to existent members via self 225# * attributes not defined in the __init__ method 226# * supported interfaces implementation 227# * unreachable code 228# 229[CLASSES] 230 231# List of method names used to declare (i.e. assign) instance attributes. 232defining-attr-methods=__init__,__new__,setUp,reset 233 234 235# checks for sign of poor/misdesign: 236# * number of methods, attributes, local variables... 237# * size, complexity of functions, methods 238# 239[DESIGN] 240 241# Maximum number of arguments for function / method 242max-args=15 243 244# Maximum number of locals for function / method body 245max-locals=50 246 247# Maximum number of return / yield for function / method body 248max-returns=20 249 250# Maximum number of branch for function / method body 251max-branches=50 252 253# Maximum number of statements in function / method body 254max-statements=150 255 256# Maximum number of parents for a class (see R0901). 257max-parents=12 258 259# Maximum number of attributes for a class (see R0902). 260max-attributes=40 261 262# Minimum number of public methods for a class (see R0903). 263min-public-methods=0 264 265# Maximum number of public methods for a class (see R0904). 266max-public-methods=500 267 268 269# checks for 270# * external modules dependencies 271# * relative / wildcard imports 272# * cyclic imports 273# * uses of deprecated modules 274# 275[IMPORTS] 276 277# Deprecated modules which should not be used, separated by a comma 278deprecated-modules=regsub,string,TERMIOS,Bastion,rexec 279 280# Create a graph of every (i.e. internal and external) dependencies in the 281# given file (report R0402 must not be disabled) 282import-graph= 283 284# Create a graph of external dependencies in the given file (report R0402 must 285# not be disabled) 286ext-import-graph= 287 288# Create a graph of internal dependencies in the given file (report R0402 must 289# not be disabled) 290int-import-graph= 291 292 293# checks for : 294# * unauthorized constructions 295# * strict indentation 296# * line length 297# * use of <> instead of != 298# 299[FORMAT] 300 301# Maximum number of characters on a single line. 302max-line-length=100 303 304# Maximum number of lines in a module 305max-module-lines=10000 306 307# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 308# tab). 309indent-string=' ' 310 311 312# checks for: 313# * warning notes in the code like FIXME, XXX 314# * PEP 263: source code with non ascii character but no encoding declaration 315# 316[MISCELLANEOUS] 317 318# List of note tags to take in consideration, separated by a comma. 319notes=FIXME,XXX,TODO 320 321 322# checks for similarities and duplicated code. This computation may be 323# memory / CPU intensive, so you should disable it if you experiments some 324# problems. 325# 326[SIMILARITIES] 327 328# Minimum lines number of a similarity. 329min-similarity-lines=4 330 331# Ignore comments when computing similarities. 332ignore-comments=yes 333 334# Ignore docstrings when computing similarities. 335ignore-docstrings=yes 336