Home | History | Annotate | Download | only in tools
      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 # Only show warnings with the listed confidence levels. Leave empty to show
     62 # all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED
     63 confidence=
     64 
     65 # Enable the message, report, category or checker with the given id(s). You can
     66 # either give multiple identifier separated by comma (,) or put this option
     67 # multiple time. See also the "--disable" option for examples.
     68 #enable=
     69 
     70 # Disable the message, report, category or checker with the given id(s). You
     71 # can either give multiple identifiers separated by comma (,) or put this
     72 # option multiple times (only on the command line, not in the configuration
     73 # file where it should appear only once).You can also use "--disable=all" to
     74 # disable everything first and then reenable specific checks. For example, if
     75 # you want to run only the similarities checker, you can use "--disable=all
     76 # --enable=similarities". If you want to run only the classes checker, but have
     77 # no Warning level messages displayed, use"--disable=all --enable=classes
     78 # --disable=W"
     79 # We leave many of the style warnings to judgement/peer review.
     80 disable=
     81     fixme,
     82     file-ignored,
     83     invalid-name,
     84     locally-disabled,
     85     locally-enabled,
     86     missing-docstring,
     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 
    165 [SPELLING]
    166 
    167 # Spelling dictionary name. Available dictionaries: none. To make it working
    168 # install python-enchant package.
    169 spelling-dict=
    170 
    171 # List of comma separated words that should not be checked.
    172 spelling-ignore-words=
    173 
    174 # A path to a file that contains private dictionary; one word per line.
    175 spelling-private-dict-file=
    176 
    177 # Tells whether to store unknown words to indicated private dictionary in
    178 # --spelling-private-dict-file option instead of raising a message.
    179 spelling-store-unknown-words=no
    180 
    181 
    182 [LOGGING]
    183 
    184 # Logging modules to check that the string format arguments are in logging
    185 # function parameter format
    186 logging-modules=logging
    187 
    188 
    189 [VARIABLES]
    190 
    191 # Tells whether we should check for unused import in __init__ files.
    192 init-import=no
    193 
    194 # A regular expression matching the name of dummy variables (i.e. expectedly
    195 # not used).
    196 dummy-variables-rgx=_|unused_
    197 
    198 # List of additional names supposed to be defined in builtins. Remember that
    199 # you should avoid to define new builtins when possible.
    200 additional-builtins=
    201 
    202 # List of strings which can identify a callback function by name. A callback
    203 # name must start or end with one of those strings.
    204 callbacks=cb_,_cb
    205 
    206 
    207 [FORMAT]
    208 
    209 # Maximum number of characters on a single line.
    210 max-line-length=80
    211 
    212 # Regexp for a line that is allowed to be longer than the limit.
    213 ignore-long-lines=^\s*(# )?<?https?://\S+>?$
    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 # List of optional constructs for which whitespace checking is disabled. `dict-
    220 # separator` is used to allow tabulation in dicts, etc.: {1  : 1,\n222: 2}.
    221 # `trailing-comma` allows a space between comma and closing bracket: (a, ).
    222 # `empty-line` allows space-only lines.
    223 no-space-check=trailing-comma,dict-separator
    224 
    225 # Maximum number of lines in a module
    226 max-module-lines=1000
    227 
    228 # String used as indentation unit. This is usually "    " (4 spaces) or "\t" (1
    229 # tab).
    230 indent-string='    '
    231 
    232 # Number of spaces of indent required inside a hanging  or continued line.
    233 indent-after-paren=4
    234 
    235 # Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
    236 expected-line-ending-format=LF
    237 
    238 
    239 [MISCELLANEOUS]
    240 
    241 # List of note tags to take in consideration, separated by a comma.
    242 notes=FIXME,XXX,TODO
    243 
    244 
    245 [BASIC]
    246 
    247 # List of builtins function names that should not be used, separated by a comma
    248 bad-functions=map,filter,input
    249 
    250 # Good variable names which should always be accepted, separated by a comma
    251 good-names=i,j,k,ex,x,_
    252 
    253 # Bad variable names which should always be refused, separated by a comma
    254 bad-names=foo,bar,baz,toto,tutu,tata
    255 
    256 # Colon-delimited sets of names that determine each other's naming style when
    257 # the name regexes allow several styles.
    258 name-group=
    259 
    260 # Include a hint for the correct naming format with invalid-name
    261 include-naming-hint=no
    262 
    263 # Regular expression matching correct function names
    264 function-rgx=[a-z_][a-z0-9_]{2,30}$
    265 
    266 # Naming hint for function names
    267 function-name-hint=[a-z_][a-z0-9_]{2,30}$
    268 
    269 # Regular expression matching correct variable names
    270 variable-rgx=[a-z_][a-z0-9_]{2,30}$
    271 
    272 # Naming hint for variable names
    273 variable-name-hint=[a-z_][a-z0-9_]{2,30}$
    274 
    275 # Regular expression matching correct constant names
    276 const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
    277 
    278 # Naming hint for constant names
    279 const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$
    280 
    281 # Regular expression matching correct attribute names
    282 attr-rgx=[a-z_][a-z0-9_]{2,30}$
    283 
    284 # Naming hint for attribute names
    285 attr-name-hint=[a-z_][a-z0-9_]{2,30}$
    286 
    287 # Regular expression matching correct argument names
    288 argument-rgx=[a-z_][a-z0-9_]{2,30}$
    289 
    290 # Naming hint for argument names
    291 argument-name-hint=[a-z_][a-z0-9_]{2,30}$
    292 
    293 # Regular expression matching correct class attribute names
    294 class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
    295 
    296 # Naming hint for class attribute names
    297 class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
    298 
    299 # Regular expression matching correct inline iteration names
    300 inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
    301 
    302 # Naming hint for inline iteration names
    303 inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$
    304 
    305 # Regular expression matching correct class names
    306 class-rgx=[A-Z_][a-zA-Z0-9]+$
    307 
    308 # Naming hint for class names
    309 class-name-hint=[A-Z_][a-zA-Z0-9]+$
    310 
    311 # Regular expression matching correct module names
    312 module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
    313 
    314 # Naming hint for module names
    315 module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
    316 
    317 # Regular expression which should only match correct method names
    318 method-rgx=[a-z_][a-z0-9_]{2,30}$
    319 
    320 # Naming hint for method names
    321 method-name-hint=[a-z_][a-z0-9_]{2,30}$
    322 
    323 # Regular expression which should only match function or class names that do
    324 # not require a docstring.
    325 no-docstring-rgx=^_
    326 
    327 # Minimum line length for functions/classes that require docstrings, shorter
    328 # ones are exempt.
    329 docstring-min-length=10
    330 
    331 
    332 [ELIF]
    333 
    334 # Maximum number of nested blocks for function / method body
    335 max-nested-blocks=5
    336 
    337 
    338 [DESIGN]
    339 
    340 # Maximum number of arguments for function / method
    341 max-args=5
    342 
    343 # Argument names that match this expression will be ignored. Default to name
    344 # with leading underscore
    345 ignored-argument-names=_.*
    346 
    347 # Maximum number of locals for function / method body
    348 max-locals=15
    349 
    350 # Maximum number of return / yield for function / method body
    351 max-returns=6
    352 
    353 # Maximum number of branch for function / method body
    354 max-branches=12
    355 
    356 # Maximum number of statements in function / method body
    357 max-statements=50
    358 
    359 # Maximum number of parents for a class (see R0901).
    360 max-parents=10
    361 
    362 # Maximum number of attributes for a class (see R0902).
    363 max-attributes=7
    364 
    365 # Minimum number of public methods for a class (see R0903).
    366 min-public-methods=2
    367 
    368 # Maximum number of public methods for a class (see R0904).
    369 max-public-methods=20
    370 
    371 # Maximum number of boolean expressions in a if statement
    372 max-bool-expr=5
    373 
    374 
    375 [CLASSES]
    376 
    377 # List of method names used to declare (i.e. assign) instance attributes.
    378 defining-attr-methods=__init__,__new__,setUp
    379 
    380 # List of valid names for the first argument in a class method.
    381 valid-classmethod-first-arg=cls
    382 
    383 # List of valid names for the first argument in a metaclass class method.
    384 valid-metaclass-classmethod-first-arg=mcs
    385 
    386 # List of member names, which should be excluded from the protected access
    387 # warning.
    388 exclude-protected=_asdict,_fields,_replace,_source,_make
    389 
    390 
    391 [IMPORTS]
    392 
    393 # Deprecated modules which should not be used, separated by a comma
    394 deprecated-modules=regsub,TERMIOS,Bastion,rexec,optparse
    395 
    396 # Create a graph of every (i.e. internal and external) dependencies in the
    397 # given file (report RP0402 must not be disabled)
    398 import-graph=
    399 
    400 # Create a graph of external dependencies in the given file (report RP0402 must
    401 # not be disabled)
    402 ext-import-graph=
    403 
    404 # Create a graph of internal dependencies in the given file (report RP0402 must
    405 # not be disabled)
    406 int-import-graph=
    407 
    408 
    409 [EXCEPTIONS]
    410 
    411 # Exceptions that will emit a warning when being caught. Defaults to
    412 # "Exception"
    413 overgeneral-exceptions=Exception
    414