David Pursehouse | 4f7bdea | 2012-10-22 12:50:15 +0900 | [diff] [blame] | 1 | # lint Python modules using external checkers. |
| 2 | # |
| 3 | # This is the main checker controling the other ones and the reports |
| 4 | # generation. It is itself both a raw checker and an astng checker in order |
| 5 | # to: |
| 6 | # * handle message activation / deactivation at the module level |
| 7 | # * handle some basic but necessary stats'data (number of classes, methods...) |
| 8 | # |
| 9 | [MASTER] |
| 10 | |
| 11 | # Specify a configuration file. |
| 12 | #rcfile= |
| 13 | |
| 14 | # Python code to execute, usually for sys.path manipulation such as |
| 15 | # pygtk.require(). |
| 16 | #init-hook= |
| 17 | |
| 18 | # Profiled execution. |
| 19 | profile=no |
| 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. |
| 23 | ignore=SVN |
| 24 | |
| 25 | # Pickle collected data for later comparisons. |
| 26 | persistent=yes |
| 27 | |
| 28 | # Set the cache size for astng objects. |
| 29 | cache-size=500 |
| 30 | |
| 31 | # List of plugins (as comma separated values of python modules names) to load, |
| 32 | # usually to register additional checkers. |
| 33 | load-plugins= |
| 34 | |
| 35 | |
| 36 | [MESSAGES CONTROL] |
| 37 | |
| 38 | # Enable only checker(s) with the given id(s). This option conflicts with the |
| 39 | # disable-checker option |
| 40 | #enable-checker= |
| 41 | |
| 42 | # Enable all checker(s) except those with the given id(s). This option |
| 43 | # conflicts with the enable-checker option |
| 44 | #disable-checker= |
| 45 | |
| 46 | # Enable all messages in the listed categories. |
| 47 | #enable-msg-cat= |
| 48 | |
| 49 | # Disable all messages in the listed categories. |
| 50 | #disable-msg-cat= |
| 51 | |
| 52 | # Enable the message(s) with the given id(s). |
| 53 | enable=RP0004 |
| 54 | |
| 55 | # Disable the message(s) with the given id(s). |
Stefan Beller | d64e8ee | 2016-06-17 16:36:47 -0700 | [diff] [blame] | 56 | disable=C0326,R0903,R0912,R0913,R0914,R0915,W0141,C0111,C0103,W0603,W0703,R0911,C0301,C0302,R0902,R0904,W0142,W0212,E1101,E1103,R0201,W0201,W0122,W0232,RP0001,RP0003,RP0101,RP0002,RP0401,RP0701,RP0801,F0401,E0611,R0801,I0011 |
David Pursehouse | 4f7bdea | 2012-10-22 12:50:15 +0900 | [diff] [blame] | 57 | |
| 58 | [REPORTS] |
| 59 | |
| 60 | # set the output format. Available formats are text, parseable, colorized, msvs |
| 61 | # (visual studio) and html |
| 62 | output-format=text |
| 63 | |
David Pursehouse | 4f7bdea | 2012-10-22 12:50:15 +0900 | [diff] [blame] | 64 | # Put messages in a separate file for each module / package specified on the |
| 65 | # command line instead of printing them on stdout. Reports (if any) will be |
| 66 | # written in a file name "pylint_global.[txt|html]". |
| 67 | files-output=no |
| 68 | |
| 69 | # Tells whether to display a full report or only the messages |
| 70 | reports=yes |
| 71 | |
| 72 | # Python expression which should return a note less than 10 (10 is the highest |
| 73 | # note).You have access to the variables errors warning, statement which |
| 74 | # respectivly contain the number of errors / warnings messages and the total |
| 75 | # number of statements analyzed. This is used by the global evaluation report |
| 76 | # (R0004). |
| 77 | evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) |
| 78 | |
| 79 | # Add a comment according to your evaluation note. This is used by the global |
| 80 | # evaluation report (R0004). |
| 81 | comment=no |
| 82 | |
| 83 | # checks for |
| 84 | # * unused variables / imports |
| 85 | # * undefined variables |
| 86 | # * redefinition of variable from builtins or from an outer scope |
| 87 | # * use of variable before assigment |
| 88 | # |
| 89 | [VARIABLES] |
| 90 | |
| 91 | # Tells whether we should check for unused import in __init__ files. |
| 92 | init-import=no |
| 93 | |
| 94 | # A regular expression matching names used for dummy variables (i.e. not used). |
| 95 | dummy-variables-rgx=_|dummy |
| 96 | |
| 97 | # List of additional names supposed to be defined in builtins. Remember that |
| 98 | # you should avoid to define new builtins when possible. |
| 99 | additional-builtins= |
| 100 | |
| 101 | |
| 102 | # try to find bugs in the code using type inference |
| 103 | # |
| 104 | [TYPECHECK] |
| 105 | |
| 106 | # Tells whether missing members accessed in mixin class should be ignored. A |
| 107 | # mixin class is detected if its name ends with "mixin" (case insensitive). |
| 108 | ignore-mixin-members=yes |
| 109 | |
| 110 | # List of classes names for which member attributes should not be checked |
| 111 | # (useful for classes with attributes dynamicaly set). |
| 112 | ignored-classes=SQLObject |
| 113 | |
| 114 | # When zope mode is activated, consider the acquired-members option to ignore |
| 115 | # access to some undefined attributes. |
| 116 | zope=no |
| 117 | |
| 118 | # List of members which are usually get through zope's acquisition mecanism and |
| 119 | # so shouldn't trigger E0201 when accessed (need zope=yes to be considered). |
| 120 | acquired-members=REQUEST,acl_users,aq_parent |
| 121 | |
| 122 | |
| 123 | # checks for : |
| 124 | # * doc strings |
| 125 | # * modules / classes / functions / methods / arguments / variables name |
| 126 | # * number of arguments, local variables, branchs, returns and statements in |
| 127 | # functions, methods |
| 128 | # * required module attributes |
| 129 | # * dangerous default values as arguments |
| 130 | # * redefinition of function / method / class |
| 131 | # * uses of the global statement |
| 132 | # |
| 133 | [BASIC] |
| 134 | |
| 135 | # Required attributes for module, separated by a comma |
| 136 | required-attributes= |
| 137 | |
| 138 | # Regular expression which should only match functions or classes name which do |
| 139 | # not require a docstring |
| 140 | no-docstring-rgx=_main|__.*__ |
| 141 | |
| 142 | # Regular expression which should only match correct module names |
| 143 | module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ |
| 144 | |
| 145 | # Regular expression which should only match correct module level names |
| 146 | const-rgx=(([A-Z_][A-Z1-9_]*)|(__.*__))|(log)$ |
| 147 | |
| 148 | # Regular expression which should only match correct class names |
| 149 | class-rgx=[A-Z_][a-zA-Z0-9]+$ |
| 150 | |
| 151 | # Regular expression which should only match correct function names |
| 152 | function-rgx=[a-z_][a-z0-9_]{2,30}$ |
| 153 | |
| 154 | # Regular expression which should only match correct method names |
| 155 | method-rgx=[a-z_][a-z0-9_]{2,30}$ |
| 156 | |
| 157 | # Regular expression which should only match correct instance attribute names |
| 158 | attr-rgx=[a-z_][a-z0-9_]{2,30}$ |
| 159 | |
| 160 | # Regular expression which should only match correct argument names |
| 161 | argument-rgx=[a-z_][a-z0-9_]{2,30}$ |
| 162 | |
| 163 | # Regular expression which should only match correct variable names |
| 164 | variable-rgx=[a-z_][a-z0-9_]{2,30}$ |
| 165 | |
| 166 | # Regular expression which should only match correct list comprehension / |
| 167 | # generator expression variable names |
| 168 | inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ |
| 169 | |
| 170 | # Good variable names which should always be accepted, separated by a comma |
| 171 | good-names=i,j,k,ex,Run,_,e,d1,d2,v,f,l,d |
| 172 | |
| 173 | # Bad variable names which should always be refused, separated by a comma |
| 174 | bad-names=foo,bar,baz,toto,tutu,tata |
| 175 | |
| 176 | # List of builtins function names that should not be used, separated by a comma |
| 177 | bad-functions=map,filter,apply,input |
| 178 | |
| 179 | |
| 180 | # checks for sign of poor/misdesign: |
| 181 | # * number of methods, attributes, local variables... |
| 182 | # * size, complexity of functions, methods |
| 183 | # |
| 184 | [DESIGN] |
| 185 | |
| 186 | # Maximum number of arguments for function / method |
| 187 | max-args=5 |
| 188 | |
| 189 | # Maximum number of locals for function / method body |
| 190 | max-locals=15 |
| 191 | |
| 192 | # Maximum number of return / yield for function / method body |
| 193 | max-returns=6 |
| 194 | |
| 195 | # Maximum number of branch for function / method body |
| 196 | max-branchs=12 |
| 197 | |
| 198 | # Maximum number of statements in function / method body |
| 199 | max-statements=50 |
| 200 | |
| 201 | # Maximum number of parents for a class (see R0901). |
| 202 | max-parents=7 |
| 203 | |
| 204 | # Maximum number of attributes for a class (see R0902). |
| 205 | max-attributes=20 |
| 206 | |
| 207 | # Minimum number of public methods for a class (see R0903). |
| 208 | min-public-methods=2 |
| 209 | |
| 210 | # Maximum number of public methods for a class (see R0904). |
| 211 | max-public-methods=30 |
| 212 | |
| 213 | |
| 214 | # checks for |
| 215 | # * external modules dependencies |
| 216 | # * relative / wildcard imports |
| 217 | # * cyclic imports |
| 218 | # * uses of deprecated modules |
| 219 | # |
| 220 | [IMPORTS] |
| 221 | |
| 222 | # Deprecated modules which should not be used, separated by a comma |
| 223 | deprecated-modules=regsub,string,TERMIOS,Bastion,rexec |
| 224 | |
| 225 | # Create a graph of every (i.e. internal and external) dependencies in the |
| 226 | # given file (report R0402 must not be disabled) |
| 227 | import-graph= |
| 228 | |
| 229 | # Create a graph of external dependencies in the given file (report R0402 must |
| 230 | # not be disabled) |
| 231 | ext-import-graph= |
| 232 | |
| 233 | # Create a graph of internal dependencies in the given file (report R0402 must |
| 234 | # not be disabled) |
| 235 | int-import-graph= |
| 236 | |
| 237 | |
| 238 | # checks for : |
| 239 | # * methods without self as first argument |
| 240 | # * overridden methods signature |
| 241 | # * access only to existant members via self |
| 242 | # * attributes not defined in the __init__ method |
| 243 | # * supported interfaces implementation |
| 244 | # * unreachable code |
| 245 | # |
| 246 | [CLASSES] |
| 247 | |
| 248 | # List of interface methods to ignore, separated by a comma. This is used for |
| 249 | # instance to not check methods defines in Zope's Interface base class. |
| 250 | ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by |
| 251 | |
| 252 | # List of method names used to declare (i.e. assign) instance attributes. |
| 253 | defining-attr-methods=__init__,__new__,setUp |
| 254 | |
| 255 | |
| 256 | # checks for similarities and duplicated code. This computation may be |
| 257 | # memory / CPU intensive, so you should disable it if you experiments some |
| 258 | # problems. |
| 259 | # |
| 260 | [SIMILARITIES] |
| 261 | |
| 262 | # Minimum lines number of a similarity. |
| 263 | min-similarity-lines=4 |
| 264 | |
| 265 | # Ignore comments when computing similarities. |
| 266 | ignore-comments=yes |
| 267 | |
| 268 | # Ignore docstrings when computing similarities. |
| 269 | ignore-docstrings=yes |
| 270 | |
| 271 | |
| 272 | # checks for: |
| 273 | # * warning notes in the code like FIXME, XXX |
| 274 | # * PEP 263: source code with non ascii character but no encoding declaration |
| 275 | # |
| 276 | [MISCELLANEOUS] |
| 277 | |
| 278 | # List of note tags to take in consideration, separated by a comma. |
| 279 | notes=FIXME,XXX,TODO |
| 280 | |
| 281 | |
| 282 | # checks for : |
| 283 | # * unauthorized constructions |
| 284 | # * strict indentation |
| 285 | # * line length |
| 286 | # * use of <> instead of != |
| 287 | # |
| 288 | [FORMAT] |
| 289 | |
| 290 | # Maximum number of characters on a single line. |
| 291 | max-line-length=80 |
| 292 | |
| 293 | # Maximum number of lines in a module |
| 294 | max-module-lines=1000 |
| 295 | |
| 296 | # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 |
| 297 | # tab). In repo it is 2 spaces. |
| 298 | indent-string=' ' |