1# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 2# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt 3 4# lint Python modules using external checkers. 5# 6# This is the main checker controling 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# Profiled execution. 22profile=no 23 24# Add <file or directory> to the black list. It should be a base name, not a 25# path. You may set this option multiple times. 26ignore= 27 28# Pickle collected data for later comparisons. 29persistent=no 30 31# Set the cache size for astng objects. 32cache-size=500 33 34# List of plugins (as comma separated values of python modules names) to load, 35# usually to register additional checkers. 36load-plugins= 37 38 39[MESSAGES CONTROL] 40 41# Enable only checker(s) with the given id(s). This option conflicts with the 42# disable-checker option 43#enable-checker= 44 45# Enable all checker(s) except those with the given id(s). This option 46# conflicts with the enable-checker option 47#disable-checker= 48 49# Enable all messages in the listed categories. 50#enable-msg-cat= 51 52# Disable all messages in the listed categories. 53#disable-msg-cat= 54 55# Enable the message(s) with the given id(s). 56enable= 57# I0021: Useless suppression 58 I0021 59 60# Disable the message(s) with the given id(s). 61disable= 62 spelling, 63# Messages that are just silly: 64# I0011:106: Locally disabling E1101 65# W0122: 30:run_python_file: Use of the exec statement 66# W0142: 31:call_singleton_method: Used * or ** magic 67# W0232: 6:AnyOldObject: Class has no __init__ method 68# C0323:311:coverage.report: Operator not followed by a space 69# C0324: 15: Comma not followed by a space 70# W0603: 28:call_singleton_method: Using the global statement 71# W0703:133:CoverageData._read_file: Catch "Exception" 72 I0011,W0122,W0142,W0232,C0323,C0324,W0603,W0703, 73# Messages that may be silly: 74# R0201: 42:Tracer.stop: Method could be a function 75# E1103: 26:RunTests.test_run_python_file: Instance of 'file' has no 'getvalue' member (but some types could not be inferred) 76 R0201,E1103, 77# formatting stuff 78 superfluous-parens,bad-continuation, 79# Messages that are noisy for now, eventually maybe we'll turn them on: 80# C0103:256:coverage.morf_filename: Invalid name "f" (should match [a-z_][a-z0-9_]{2,30}$) 81# W0212: 86:Reporter.report_files: Access to a protected member _analyze of a client class 82 C0103,W0212, 83 duplicate-code, 84 cyclic-import 85 86msg-template={path}:{line}: {msg} ({symbol}) 87 88[REPORTS] 89 90# set the output format. Available formats are text, parseable, colorized, msvs 91# (visual studio) and html 92output-format=text 93 94# Put messages in a separate file for each module / package specified on the 95# command line instead of printing them on stdout. Reports (if any) will be 96# written in a file name "pylint_global.[txt|html]". 97files-output=no 98 99# Tells wether to display a full report or only the messages 100reports=no 101 102# Python expression which should return a note less than 10 (10 is the highest 103# note).You have access to the variables errors warning, statement which 104# respectivly contain the number of errors / warnings messages and the total 105# number of statements analyzed. This is used by the global evaluation report 106# (R0004). 107evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) 108 109# Add a comment according to your evaluation note. This is used by the global 110# evaluation report (R0004). 111comment=no 112 113# Enable the report(s) with the given id(s). 114#enable-report= 115 116# Disable the report(s) with the given id(s). 117#disable-report= 118 119 120# checks for : 121# * doc strings 122# * modules / classes / functions / methods / arguments / variables name 123# * number of arguments, local variables, branchs, returns and statements in 124# functions, methods 125# * required module attributes 126# * dangerous default values as arguments 127# * redefinition of function / method / class 128# * uses of the global statement 129# 130[BASIC] 131 132# Required attributes for module, separated by a comma 133required-attributes= 134 135# Regular expression which should only match functions or classes name which do 136# not require a docstring 137no-docstring-rgx=__.*__|test[A-Z_].*|setUp|tearDown 138 139# Regular expression which should only match correct module names 140module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ 141 142# Regular expression which should only match correct module level names 143const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ 144 145# Regular expression which should only match correct class names 146class-rgx=[A-Z_][a-zA-Z0-9]+$ 147 148# Regular expression which should only match correct function names 149function-rgx=[a-z_][a-z0-9_]{2,30}$ 150 151# Regular expression which should only match correct method names 152method-rgx=[a-z_][a-z0-9_]{2,30}$|setUp|tearDown|test_.* 153 154# Regular expression which should only match correct instance attribute names 155attr-rgx=[a-z_][a-z0-9_]{2,30}$ 156 157# Regular expression which should only match correct argument names 158argument-rgx=[a-z_][a-z0-9_]{2,30}$ 159 160# Regular expression which should only match correct variable names 161variable-rgx=[a-z_][a-z0-9_]{2,30}$ 162 163# Regular expression which should only match correct list comprehension / 164# generator expression variable names 165inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ 166 167# Good variable names which should always be accepted, separated by a comma 168good-names=i,j,k,ex,Run,_ 169 170# Bad variable names which should always be refused, separated by a comma 171bad-names=foo,bar,baz,toto,tutu,tata 172 173# List of builtins function names that should not be used, separated by a comma 174bad-functions= 175 176 177# try to find bugs in the code using type inference 178# 179[TYPECHECK] 180 181# Tells wether missing members accessed in mixin class should be ignored. A 182# mixin class is detected if its name ends with "mixin" (case insensitive). 183ignore-mixin-members=yes 184 185# List of classes names for which member attributes should not be checked 186# (useful for classes with attributes dynamicaly set). 187ignored-classes=SQLObject 188 189# When zope mode is activated, consider the acquired-members option to ignore 190# access to some undefined attributes. 191zope=no 192 193# List of members which are usually get through zope's acquisition mecanism and 194# so shouldn't trigger E0201 when accessed (need zope=yes to be considered). 195acquired-members=REQUEST,acl_users,aq_parent 196 197 198# checks for 199# * unused variables / imports 200# * undefined variables 201# * redefinition of variable from builtins or from an outer scope 202# * use of variable before assigment 203# 204[VARIABLES] 205 206# Tells wether we should check for unused import in __init__ files. 207init-import=no 208 209# A regular expression matching names used for dummy variables (i.e. not used). 210dummy-variables-rgx=_|dummy|unused|.*_unused 211 212# List of additional names supposed to be defined in builtins. Remember that 213# you should avoid to define new builtins when possible. 214additional-builtins= 215 216 217# checks for : 218# * methods without self as first argument 219# * overridden methods signature 220# * access only to existant members via self 221# * attributes not defined in the __init__ method 222# * supported interfaces implementation 223# * unreachable code 224# 225[CLASSES] 226 227# List of interface methods to ignore, separated by a comma. This is used for 228# instance to not check methods defines in Zope's Interface base class. 229ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by 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 337# 338# SPELLING 339# 340 341spelling-dict=en_US 342# pylint doesn't strip the words, so insert a dummy x at the beginning to make 343# the other words work properly. 344# https://bitbucket.org/logilab/pylint/issue/398/spelling-words-need-to-be-stripped-or-the 345spelling-private-dict-file=doc/dict.txt 346