1 # Copyright 2016 The Android Open Source Project 2 # 3 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # you may not use this file except in compliance with the License. 5 # You may obtain a copy of the License at 6 # 7 # http://www.apache.org/licenses/LICENSE-2.0 8 # 9 # Unless required by applicable law or agreed to in writing, software 10 # distributed under the License is distributed on an "AS IS" BASIS, 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 # See the License for the specific language governing permissions and 13 # limitations under the License. 14 15 [MASTER] 16 17 # Specify a configuration file. 18 #rcfile= 19 20 # Python code to execute, usually for sys.path manipulation such as 21 # pygtk.require(). 22 #init-hook= 23 24 # Profiled execution. 25 profile=no 26 27 # Add files or directories to the blacklist. They should be base names, not 28 # paths. 29 ignore=CVS,.svn,.git 30 31 # Pickle collected data for later comparisons. 32 persistent=yes 33 34 # List of plugins (as comma separated values of python modules names) to load, 35 # usually to register additional checkers. 36 load-plugins= 37 38 # Use multiple processes to speed up Pylint. 39 jobs=1 40 41 # Allow loading of arbitrary C extensions. Extensions are imported into the 42 # active Python interpreter and may run arbitrary code. 43 unsafe-load-any-extension=no 44 45 # A comma-separated list of package or module names from where C extensions may 46 # be loaded. Extensions are loading into the active Python interpreter and may 47 # run arbitrary code 48 extension-pkg-whitelist= 49 50 # Allow optimization of some AST trees. This will activate a peephole AST 51 # optimizer, which will apply various small optimizations. For instance, it can 52 # be used to obtain the result of joining multiple strings with the addition 53 # operator. Joining a lot of strings can lead to a maximum recursion error in 54 # Pylint and this flag can prevent that. It has one side effect, the resulting 55 # AST will be different than the one from reality. 56 optimize-ast=no 57 58 59 [MESSAGES CONTROL] 60 61 # List of checkers and warnings to enable. 62 enable=old-raise-syntax 63 64 # Only show warnings with the listed confidence levels. Leave empty to show 65 # all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED 66 confidence= 67 68 # Enable the message, report, category or checker with the given id(s). You can 69 # either give multiple identifier separated by comma (,) or put this option 70 # multiple time. See also the "--disable" option for examples. 71 #enable= 72 73 # Disable the message, report, category or checker with the given id(s). You 74 # can either give multiple identifiers separated by comma (,) or put this 75 # option multiple times (only on the command line, not in the configuration 76 # file where it should appear only once).You can also use "--disable=all" to 77 # disable everything first and then reenable specific checks. For example, if 78 # you want to run only the similarities checker, you can use "--disable=all 79 # --enable=similarities". If you want to run only the classes checker, but have 80 # no Warning level messages displayed, use"--disable=all --enable=classes 81 # --disable=W" 82 # We leave many of the style warnings to judgement/peer review. 83 disable= 84 fixme, 85 locally-disabled, 86 locally-enabled, 87 no-self-use, 88 star-args, 89 too-few-public-methods, 90 too-many-arguments, 91 too-many-branches, 92 too-many-instance-attributes, 93 too-many-lines, 94 too-many-locals, 95 too-many-public-methods, 96 too-many-return-statements, 97 too-many-statements, 98 99 100 [REPORTS] 101 102 # Set the output format. Available formats are text, parseable, colorized, msvs 103 # (visual studio) and html. You can also give a reporter class, eg 104 # mypackage.mymodule.MyReporterClass. 105 output-format=text 106 107 # Put messages in a separate file for each module / package specified on the 108 # command line instead of printing them on stdout. Reports (if any) will be 109 # written in a file name "pylint_global.[txt|html]". 110 files-output=no 111 112 # Tells whether to display a full report or only the messages 113 reports=no 114 115 # Python expression which should return a note less than 10 (10 is the highest 116 # note). You have access to the variables errors warning, statement which 117 # respectively contain the number of errors / warnings messages and the total 118 # number of statements analyzed. This is used by the global evaluation report 119 # (RP0004). 120 #evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) 121 122 # Template used to display messages. This is a python new-style format string 123 # used to format the message information. See doc for all details 124 #msg-template= 125 126 127 [SIMILARITIES] 128 129 # Minimum lines number of a similarity. 130 min-similarity-lines=20 131 132 # Ignore comments when computing similarities. 133 ignore-comments=yes 134 135 # Ignore docstrings when computing similarities. 136 ignore-docstrings=yes 137 138 # Ignore imports when computing similarities. 139 ignore-imports=no 140 141 142 [TYPECHECK] 143 144 # Tells whether missing members accessed in mixin class should be ignored. A 145 # mixin class is detected if its name ends with "mixin" (case insensitive). 146 ignore-mixin-members=yes 147 148 # List of module names for which member attributes should not be checked 149 # (useful for modules/projects where namespaces are manipulated during runtime 150 # and thus existing member attributes cannot be deduced by static analysis. It 151 # supports qualified module names, as well as Unix pattern matching. 152 ignored-modules= 153 154 # List of classes names for which member attributes should not be checked 155 # (useful for classes with attributes dynamically set). This supports can work 156 # with qualified names. 157 ignored-classes=hashlib,numpy 158 159 # List of members which are set dynamically and missed by pylint inference 160 # system, and so shouldn't trigger E1101 when accessed. Python regular 161 # expressions are accepted. 162 generated-members= 163 164 # List of decorators that create context managers from functions, such as 165 # contextlib.contextmanager. 166 contextmanager-decorators=contextlib.contextmanager,contextlib2.contextmanager 167 168 169 [SPELLING] 170 171 # Spelling dictionary name. Available dictionaries: none. To make it working 172 # install python-enchant package. 173 spelling-dict= 174 175 # List of comma separated words that should not be checked. 176 spelling-ignore-words= 177 178 # A path to a file that contains private dictionary; one word per line. 179 spelling-private-dict-file= 180 181 # Tells whether to store unknown words to indicated private dictionary in 182 # --spelling-private-dict-file option instead of raising a message. 183 spelling-store-unknown-words=no 184 185 186 [LOGGING] 187 188 # Logging modules to check that the string format arguments are in logging 189 # function parameter format 190 logging-modules=logging 191 192 193 [VARIABLES] 194 195 # Tells whether we should check for unused import in __init__ files. 196 init-import=no 197 198 # A regular expression matching names used for dummy variables (i.e. not used). 199 dummy-variables-rgx=^\*{0,2}(_$|unused_|dummy_) 200 201 # List of additional names supposed to be defined in builtins. Remember that 202 # you should avoid to define new builtins when possible. 203 additional-builtins= 204 205 # List of strings which can identify a callback function by name. A callback 206 # name must start or end with one of those strings. 207 callbacks=cb_,_cb 208 209 210 [FORMAT] 211 212 # Maximum number of characters on a single line. 213 max-line-length=80 214 215 # Allow the body of an if to be on the same line as the test if there is no 216 # else. 217 single-line-if-stmt=no 218 219 # Regexp for a line that is allowed to be longer than the limit. 220 # This "ignore" regex is today composed of 4 independent parts: 221 # (1) Long import lines 222 # (2) URLs in comments or pydocs. Detecting URLs by regex is a hard problem and 223 # no amount of tweaking will make a perfect regex AFAICT. This one is a good 224 # compromise. 225 # (3) Constant string literals at the start of files don't need to be broken 226 # across lines. Allowing long paths, streamz and urls to be on a single 227 # line. Also requires that the string not be a triplequoted string. 228 ignore-long-lines=(?x) 229 (^\s*(import|from)\s 230 |^\s*(\#\ )?<?(https?|ftp):\/\/[^\s\/$.?#].[^\s]*>?$ 231 |^[a-zA-Z_][a-zA-Z0-9_]*\s*=\s*("[^"]\S+"|'[^']\S+') 232 ) 233 234 # Maximum number of lines in a module 235 max-module-lines=99999 236 237 # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 238 # tab). 239 indent-string=' ' 240 241 # Number of spaces of indent required inside a hanging or continued line. 242 indent-after-paren=4 243 244 # Expected format of line ending, e.g. empty (any line ending), LF or CRLF. 245 expected-line-ending-format=LF 246 247 # Make sure : in dicts and trailing commas are checked for whitespace. 248 no-space-check= 249 250 251 [MISCELLANEOUS] 252 253 # List of note tags to take in consideration, separated by a comma. 254 notes=FIXME,XXX,TODO 255 256 257 [BASIC] 258 259 # Required attributes for module, separated by a comma 260 required-attributes= 261 262 # List of builtins function names that should not be used, separated by a comma 263 bad-functions=map,filter,input,apply,reduce 264 265 # Good variable names which should always be accepted, separated by a comma 266 good-names=i,j,k,ex,x,_ 267 268 # Bad variable names which should always be refused, separated by a comma 269 bad-names=foo,bar,baz,toto,tutu,tata 270 271 # Colon-delimited sets of names that determine each other's naming style when 272 # the name regexes allow several styles. 273 name-group= 274 275 # Include a hint for the correct naming format with invalid-name 276 include-naming-hint=no 277 278 # Regular expression which should only match correct function names. 279 # 'camel_case' and 'snake_case' group names are used for consistency of naming 280 # styles across functions and methods. 281 function-rgx=^(?:(?P<camel_case>_?[A-Z][a-zA-Z0-9]*)|(?P<snake_case>_?[a-z][a-z0-9_]*))$ 282 283 # Naming hint for function names 284 function-name-hint=[a-z_][a-z0-9_]{2,30}$ 285 286 # Regular expression which should only match correct variable names 287 variable-rgx=^[a-z][a-z0-9_]*$ 288 289 # Naming hint for variable names 290 variable-name-hint=[a-z_][a-z0-9_]{2,30}$ 291 292 # Regular expression which should only match correct module level names 293 const-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$ 294 295 # Naming hint for constant names 296 const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$ 297 298 # Regular expression which should only match correct instance attribute names 299 attr-rgx=^_{0,2}[a-z][a-z0-9_]*$ 300 301 # Naming hint for attribute names 302 attr-name-hint=[a-z_][a-z0-9_]{2,30}$ 303 304 # Regular expression which should only match correct argument names 305 argument-rgx=^[a-z][a-z0-9_]*$ 306 307 # Naming hint for argument names 308 argument-name-hint=[a-z_][a-z0-9_]{2,30}$ 309 310 # Regular expression which should only match correct class attribute 311 class-attribute-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$ 312 313 # Naming hint for class attribute names 314 class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ 315 316 # Regular expression which should only match correct list comprehension / 317 # generator expression variable names 318 inlinevar-rgx=^[a-z][a-z0-9_]*$ 319 320 # Naming hint for inline iteration names 321 inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$ 322 323 # Regular expression which should only match correct class names 324 class-rgx=^_?[A-Z][a-zA-Z0-9]*$ 325 326 # Naming hint for class names 327 class-name-hint=[A-Z_][a-zA-Z0-9]+$ 328 329 # Regular expression which should only match correct module names. The 330 # leading underscore is sanctioned for private modules by Google's style 331 # guide. 332 module-rgx=^(_?[a-z][a-z0-9_]*)|__init__$ 333 334 # Naming hint for module names 335 module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ 336 337 # Regular expression which should only match correct method names. 338 # 'camel_case' and 'snake_case' group names are used for consistency of naming 339 # styles across functions and methods. 'exempt' indicates a name which is 340 # consistent with all naming styles. 341 method-rgx=^(?:(?P<exempt>__[a-z0-9_]+__|next)|(?P<camel_case>_{0,2}[A-Z][a-zA-Z0-9]*)|(?P<snake_case>_{0,2}[a-z][a-z0-9_]*))$ 342 343 # Naming hint for method names 344 method-name-hint=[a-z_][a-z0-9_]{2,30}$ 345 346 # Regular expression which should only match function or class names that do 347 # not require a docstring. 348 no-docstring-rgx=(__.*__|main) 349 350 # Minimum line length for functions/classes that require docstrings, shorter 351 # ones are exempt. 352 docstring-min-length=10 353 354 # List of decorators that define properties, such as abc.abstractproperty. 355 property-classes=abc.abstractproperty 356 357 358 [ELIF] 359 360 # Maximum number of nested blocks for function / method body 361 max-nested-blocks=5 362 363 364 [DESIGN] 365 366 # Maximum number of arguments for function / method 367 max-args=5 368 369 # Argument names that match this expression will be ignored. Default to name 370 # with leading underscore 371 ignored-argument-names=_.* 372 373 # Maximum number of locals for function / method body 374 max-locals=15 375 376 # Maximum number of return / yield for function / method body 377 max-returns=6 378 379 # Maximum number of branch for function / method body 380 max-branches=12 381 382 # Maximum number of statements in function / method body 383 max-statements=50 384 385 # Maximum number of parents for a class (see R0901). 386 max-parents=10 387 388 # Maximum number of attributes for a class (see R0902). 389 max-attributes=7 390 391 # Minimum number of public methods for a class (see R0903). 392 min-public-methods=2 393 394 # Maximum number of public methods for a class (see R0904). 395 max-public-methods=20 396 397 # Maximum number of boolean expressions in a if statement 398 max-bool-expr=5 399 400 401 [CLASSES] 402 403 # List of method names used to declare (i.e. assign) instance attributes. 404 defining-attr-methods=__init__,__new__,setUp 405 406 # List of valid names for the first argument in a class method. 407 valid-classmethod-first-arg=cls 408 409 # List of valid names for the first argument in a metaclass class method. 410 valid-metaclass-classmethod-first-arg=mcs 411 412 # List of member names, which should be excluded from the protected access 413 # warning. 414 exclude-protected=_asdict,_fields,_replace,_source,_make 415 416 417 [IMPORTS] 418 419 # Deprecated modules which should not be used, separated by a comma 420 deprecated-modules=regsub,TERMIOS,Bastion,rexec,optparse 421 422 # Create a graph of every (i.e. internal and external) dependencies in the 423 # given file (report RP0402 must not be disabled) 424 import-graph= 425 426 # Create a graph of external dependencies in the given file (report RP0402 must 427 # not be disabled) 428 ext-import-graph= 429 430 # Create a graph of internal dependencies in the given file (report RP0402 must 431 # not be disabled) 432 int-import-graph= 433 434 435 [EXCEPTIONS] 436 437 # Exceptions that will emit a warning when being caught. Defaults to 438 # "Exception" 439 overgeneral-exceptions=StandardError,Exception,BaseException 440