| 1 |
# |
| 2 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 |
# you may not use this file except in compliance with the License. |
| 4 |
# You may obtain a copy of the License at |
| 5 |
# |
| 6 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 7 |
# |
| 8 |
# Unless required by applicable law or agreed to in writing, software |
| 9 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 10 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 |
# See the License for the specific language governing permissions and |
| 12 |
# limitations under the License. |
| 13 |
# |
| 14 |
[MASTER] |
| 15 |
|
| 16 |
# A comma-separated list of package or module names from where C extensions may |
| 17 |
# be loaded. Extensions are loading into the active Python interpreter and may |
| 18 |
# run arbitrary code |
| 19 |
extension-pkg-whitelist= |
| 20 |
buildstream.node, |
| 21 |
buildstream._loader.loadelement, |
| 22 |
buildstream._loader.types, |
| 23 |
buildstream._types, |
| 24 |
buildstream._utils, |
| 25 |
buildstream._variables, |
| 26 |
buildstream._yaml, |
| 27 |
ujson |
| 28 |
|
| 29 |
# Add files or directories to the blacklist. They should be base names, not |
| 30 |
# paths. |
| 31 |
ignore=CVS,doc |
| 32 |
|
| 33 |
# Add files or directories matching the regex patterns to the blacklist. The |
| 34 |
# regex matches against base names, not paths. |
| 35 |
ignore-patterns=.*_pb2.py,.*_pb2_grpc.py |
| 36 |
|
| 37 |
# Python code to execute, usually for sys.path manipulation such as |
| 38 |
# pygtk.require(). |
| 39 |
#init-hook= |
| 40 |
|
| 41 |
# Use multiple processes to speed up Pylint. |
| 42 |
jobs=1 |
| 43 |
|
| 44 |
# List of plugins (as comma separated values of python modules names) to load, |
| 45 |
# usually to register additional checkers. |
| 46 |
load-plugins= |
| 47 |
|
| 48 |
# Pickle collected data for later comparisons. |
| 49 |
persistent=yes |
| 50 |
|
| 51 |
# Specify a configuration file. |
| 52 |
#rcfile= |
| 53 |
|
| 54 |
# When enabled, pylint would attempt to guess common misconfiguration and emit |
| 55 |
# user-friendly hints instead of false-positive error messages |
| 56 |
suggestion-mode=yes |
| 57 |
|
| 58 |
# Allow loading of arbitrary C extensions. Extensions are imported into the |
| 59 |
# active Python interpreter and may run arbitrary code. |
| 60 |
unsafe-load-any-extension=no |
| 61 |
|
| 62 |
|
| 63 |
[MESSAGES CONTROL] |
| 64 |
|
| 65 |
# Only show warnings with the listed confidence levels. Leave empty to show |
| 66 |
# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED |
| 67 |
confidence= |
| 68 |
|
| 69 |
# Disable the message, report, category or checker with the given id(s). You |
| 70 |
# can either give multiple identifiers separated by comma (,) or put this |
| 71 |
# option multiple times (only on the command line, not in the configuration |
| 72 |
# file where it should appear only once).You can also use "--disable=all" to |
| 73 |
# disable everything first and then reenable specific checks. For example, if |
| 74 |
# you want to run only the similarities checker, you can use "--disable=all |
| 75 |
# --enable=similarities". If you want to run only the classes checker, but have |
| 76 |
# no Warning level messages displayed, use"--disable=all --enable=classes |
| 77 |
# --disable=W" |
| 78 |
|
| 79 |
# We have three groups of disabled messages: |
| 80 |
# |
| 81 |
# 1) Messages that are of no use to us |
| 82 |
# This is either because we don't follow the convention |
| 83 |
# (missing-docstring and protected-access come to mind), or because |
| 84 |
# it's not very useful in CI (too-many-arguments, for example) |
| 85 |
# |
| 86 |
# 2) Messages that we would like to enable at some point |
| 87 |
# We introduced linting quite late into the project, so there are |
| 88 |
# some issues that just grew out of control. Resolving these would |
| 89 |
# be nice, but too much work atm. |
| 90 |
# |
| 91 |
# 3) Messages related to code formatting |
| 92 |
# Since we use Black to format code automatically, there's no need for |
| 93 |
# pylint to also check for those things. |
| 94 |
# |
| 95 |
|
| 96 |
disable= |
| 97 |
##################################### |
| 98 |
# Messages that are of no use to us # |
| 99 |
##################################### |
| 100 |
, |
| 101 |
consider-using-f-string, |
| 102 |
fixme, |
| 103 |
missing-docstring, |
| 104 |
no-else-return, |
| 105 |
protected-access, |
| 106 |
too-few-public-methods, |
| 107 |
too-many-arguments, |
| 108 |
too-many-boolean-expressions, |
| 109 |
too-many-branches, |
| 110 |
too-many-instance-attributes, |
| 111 |
too-many-lines, |
| 112 |
too-many-locals, |
| 113 |
too-many-nested-blocks, |
| 114 |
too-many-positional-arguments, |
| 115 |
too-many-public-methods, |
| 116 |
too-many-statements, |
| 117 |
too-many-return-statements, |
| 118 |
too-many-ancestors, |
| 119 |
|
| 120 |
# BuildStream plugins define instance variables in configure() |
| 121 |
attribute-defined-outside-init, |
| 122 |
|
| 123 |
####################################################### |
| 124 |
# Messages that we would like to enable at some point # |
| 125 |
####################################################### |
| 126 |
# We have many circular imports that need breaking |
| 127 |
import-outside-toplevel, |
| 128 |
|
| 129 |
duplicate-code, |
| 130 |
|
| 131 |
# Some invalid names are alright, we should configure pylint |
| 132 |
# to accept them, and curb the others |
| 133 |
invalid-name, |
| 134 |
|
| 135 |
unused-argument, |
| 136 |
|
| 137 |
# This is good to get context on exceptions, we should enable that |
| 138 |
# at some point |
| 139 |
raise-missing-from, |
| 140 |
|
| 141 |
# We can probably enable this soon, it is a bit experimental |
| 142 |
# for the moment and current releases of pylint (August 2021) raise |
| 143 |
# a lot of false positives. |
| 144 |
unused-private-member, |
| 145 |
|
| 146 |
################################################## |
| 147 |
# Formatting-related messages, enforced by Black # |
| 148 |
################################################## |
| 149 |
|
| 150 |
line-too-long, |
| 151 |
superfluous-parens, |
| 152 |
|
| 153 |
|
| 154 |
# Enable the message, report, category or checker with the given id(s). You can |
| 155 |
# either give multiple identifier separated by comma (,) or put this option |
| 156 |
# multiple time (only on the command line, not in the configuration file where |
| 157 |
# it should appear only once). See also the "--disable" option for examples. |
| 158 |
enable=c-extension-no-member |
| 159 |
|
| 160 |
|
| 161 |
[REPORTS] |
| 162 |
|
| 163 |
# Python expression which should return a note less than 10 (10 is the highest |
| 164 |
# note). You have access to the variables errors warning, statement which |
| 165 |
# respectively contain the number of errors / warnings messages and the total |
| 166 |
# number of statements analyzed. This is used by the global evaluation report |
| 167 |
# (RP0004). |
| 168 |
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) |
| 169 |
|
| 170 |
# Template used to display messages. This is a python new-style format string |
| 171 |
# used to format the message information. See doc for all details |
| 172 |
#msg-template= |
| 173 |
|
| 174 |
# Set the output format. Available formats are text, parseable, colorized, json |
| 175 |
# and msvs (visual studio).You can also give a reporter class, eg |
| 176 |
# mypackage.mymodule.MyReporterClass. |
| 177 |
output-format=colorized |
| 178 |
|
| 179 |
# Tells whether to display a full report or only the messages |
| 180 |
reports=no |
| 181 |
|
| 182 |
# Activate the evaluation score. |
| 183 |
score=yes |
| 184 |
|
| 185 |
|
| 186 |
[REFACTORING] |
| 187 |
|
| 188 |
# Maximum number of nested blocks for function / method body |
| 189 |
max-nested-blocks=5 |
| 190 |
|
| 191 |
# Complete name of functions that never returns. When checking for |
| 192 |
# inconsistent-return-statements if a never returning function is called then |
| 193 |
# it will be considered as an explicit return statement and no message will be |
| 194 |
# printed. |
| 195 |
never-returning-functions=optparse.Values,sys.exit |
| 196 |
|
| 197 |
|
| 198 |
[TYPECHECK] |
| 199 |
|
| 200 |
# List of decorators that produce context managers, such as |
| 201 |
# contextlib.contextmanager. Add to this list to register other decorators that |
| 202 |
# produce valid context managers. |
| 203 |
contextmanager-decorators=contextlib.contextmanager |
| 204 |
|
| 205 |
# List of members which are set dynamically and missed by pylint inference |
| 206 |
# system, and so shouldn't trigger E1101 when accessed. Python regular |
| 207 |
# expressions are accepted. |
| 208 |
generated-members=__enter__ |
| 209 |
|
| 210 |
# Tells whether missing members accessed in mixin class should be ignored. A |
| 211 |
# mixin class is detected if its name ends with "mixin" (case insensitive). |
| 212 |
ignore-mixin-members=yes |
| 213 |
|
| 214 |
# This flag controls whether pylint should warn about no-member and similar |
| 215 |
# checks whenever an opaque object is returned when inferring. The inference |
| 216 |
# can return multiple potential results while evaluating a Python object, but |
| 217 |
# some branches might not be evaluated, which results in partial inference. In |
| 218 |
# that case, it might be useful to still emit no-member and other checks for |
| 219 |
# the rest of the inferred objects. |
| 220 |
ignore-on-opaque-inference=yes |
| 221 |
|
| 222 |
# List of class names for which member attributes should not be checked (useful |
| 223 |
# for classes with dynamically set attributes). This supports the use of |
| 224 |
# qualified names. |
| 225 |
ignored-classes=optparse.Values,thread._local,_thread._local,contextlib.closing,gi.repository.GLib.GError,pathlib.PurePath |
| 226 |
|
| 227 |
# List of module names for which member attributes should not be checked |
| 228 |
# (useful for modules/projects where namespaces are manipulated during runtime |
| 229 |
# and thus existing member attributes cannot be deduced by static analysis. It |
| 230 |
# supports qualified module names, as well as Unix pattern matching. |
| 231 |
ignored-modules=pkg_resources,gi.repository,grpc,buildstream._protos.* |
| 232 |
|
| 233 |
# Show a hint with possible names when a member name was not found. The aspect |
| 234 |
# of finding the hint is based on edit distance. |
| 235 |
missing-member-hint=yes |
| 236 |
|
| 237 |
# The minimum edit distance a name should have in order to be considered a |
| 238 |
# similar match for a missing member name. |
| 239 |
missing-member-hint-distance=1 |
| 240 |
|
| 241 |
# The total number of similar names that should be taken in consideration when |
| 242 |
# showing a hint for a missing member. |
| 243 |
missing-member-max-choices=1 |
| 244 |
|
| 245 |
|
| 246 |
[BASIC] |
| 247 |
|
| 248 |
# Naming style matching correct argument names |
| 249 |
argument-naming-style=snake_case |
| 250 |
|
| 251 |
# Regular expression matching correct argument names. Overrides argument- |
| 252 |
# naming-style |
| 253 |
#argument-rgx= |
| 254 |
|
| 255 |
# Naming style matching correct attribute names |
| 256 |
attr-naming-style=snake_case |
| 257 |
|
| 258 |
# Regular expression matching correct attribute names. Overrides attr-naming- |
| 259 |
# style |
| 260 |
#attr-rgx= |
| 261 |
|
| 262 |
# Bad variable names which should always be refused, separated by a comma |
| 263 |
bad-names=foo, |
| 264 |
bar, |
| 265 |
baz, |
| 266 |
toto, |
| 267 |
tutu, |
| 268 |
tata |
| 269 |
|
| 270 |
# Naming style matching correct class attribute names |
| 271 |
class-attribute-naming-style=any |
| 272 |
|
| 273 |
# Regular expression matching correct class attribute names. Overrides class- |
| 274 |
# attribute-naming-style |
| 275 |
#class-attribute-rgx= |
| 276 |
|
| 277 |
# Naming style matching correct class names |
| 278 |
class-naming-style=PascalCase |
| 279 |
|
| 280 |
# Regular expression matching correct class names. Overrides class-naming-style |
| 281 |
#class-rgx= |
| 282 |
|
| 283 |
# Naming style matching correct constant names |
| 284 |
const-naming-style=UPPER_CASE |
| 285 |
|
| 286 |
# Regular expression matching correct constant names. Overrides const-naming- |
| 287 |
# style |
| 288 |
#const-rgx= |
| 289 |
|
| 290 |
# Minimum line length for functions/classes that require docstrings, shorter |
| 291 |
# ones are exempt. |
| 292 |
docstring-min-length=-1 |
| 293 |
|
| 294 |
# Naming style matching correct function names |
| 295 |
function-naming-style=snake_case |
| 296 |
|
| 297 |
# Regular expression matching correct function names. Overrides function- |
| 298 |
# naming-style |
| 299 |
#function-rgx= |
| 300 |
|
| 301 |
# Good variable names which should always be accepted, separated by a comma |
| 302 |
good-names=i,j,k,ex,Run,_,e,f |
| 303 |
|
| 304 |
# Include a hint for the correct naming format with invalid-name |
| 305 |
include-naming-hint=no |
| 306 |
|
| 307 |
# Naming style matching correct inline iteration names |
| 308 |
inlinevar-naming-style=any |
| 309 |
|
| 310 |
# Regular expression matching correct inline iteration names. Overrides |
| 311 |
# inlinevar-naming-style |
| 312 |
#inlinevar-rgx= |
| 313 |
|
| 314 |
# Naming style matching correct method names |
| 315 |
method-naming-style=snake_case |
| 316 |
|
| 317 |
# Regular expression matching correct method names. Overrides method-naming- |
| 318 |
# style |
| 319 |
#method-rgx= |
| 320 |
|
| 321 |
# Naming style matching correct module names |
| 322 |
module-naming-style=snake_case |
| 323 |
|
| 324 |
# Regular expression matching correct module names. Overrides module-naming- |
| 325 |
# style |
| 326 |
#module-rgx= |
| 327 |
|
| 328 |
# Colon-delimited sets of names that determine each other's naming style when |
| 329 |
# the name regexes allow several styles. |
| 330 |
name-group= |
| 331 |
|
| 332 |
# Regular expression which should only match function or class names that do |
| 333 |
# not require a docstring. |
| 334 |
no-docstring-rgx=^_ |
| 335 |
|
| 336 |
# List of decorators that produce properties, such as abc.abstractproperty. Add |
| 337 |
# to this list to register other decorators that produce valid properties. |
| 338 |
property-classes=abc.abstractproperty |
| 339 |
|
| 340 |
# Naming style matching correct variable names |
| 341 |
variable-naming-style=snake_case |
| 342 |
|
| 343 |
# Regular expression matching correct variable names. Overrides variable- |
| 344 |
# naming-style |
| 345 |
#variable-rgx= |
| 346 |
|
| 347 |
|
| 348 |
[VARIABLES] |
| 349 |
|
| 350 |
# List of additional names supposed to be defined in builtins. Remember that |
| 351 |
# you should avoid to define new builtins when possible. |
| 352 |
additional-builtins= |
| 353 |
|
| 354 |
# Tells whether unused global variables should be treated as a violation. |
| 355 |
allow-global-unused-variables=yes |
| 356 |
|
| 357 |
# List of strings which can identify a callback function by name. A callback |
| 358 |
# name must start or end with one of those strings. |
| 359 |
callbacks=cb_, |
| 360 |
_cb |
| 361 |
|
| 362 |
# A regular expression matching the name of dummy variables (i.e. expectedly |
| 363 |
# not used). |
| 364 |
dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ |
| 365 |
|
| 366 |
# Argument names that match this expression will be ignored. Default to name |
| 367 |
# with leading underscore |
| 368 |
ignored-argument-names=_.*|^ignored_|^unused_ |
| 369 |
|
| 370 |
# Tells whether we should check for unused import in __init__ files. |
| 371 |
init-import=no |
| 372 |
|
| 373 |
# List of qualified module names which can have objects that can redefine |
| 374 |
# builtins. |
| 375 |
redefining-builtins-modules=six.moves,past.builtins,future.builtins |
| 376 |
|
| 377 |
|
| 378 |
[LOGGING] |
| 379 |
|
| 380 |
# Logging modules to check that the string format arguments are in logging |
| 381 |
# function parameter format |
| 382 |
logging-modules=logging |
| 383 |
|
| 384 |
|
| 385 |
[SPELLING] |
| 386 |
|
| 387 |
# Limits count of emitted suggestions for spelling mistakes |
| 388 |
max-spelling-suggestions=4 |
| 389 |
|
| 390 |
# Spelling dictionary name. Available dictionaries: none. To make it working |
| 391 |
# install python-enchant package. |
| 392 |
spelling-dict= |
| 393 |
|
| 394 |
# List of comma separated words that should not be checked. |
| 395 |
spelling-ignore-words= |
| 396 |
|
| 397 |
# A path to a file that contains private dictionary; one word per line. |
| 398 |
spelling-private-dict-file= |
| 399 |
|
| 400 |
# Tells whether to store unknown words to indicated private dictionary in |
| 401 |
# --spelling-private-dict-file option instead of raising a message. |
| 402 |
spelling-store-unknown-words=no |
| 403 |
|
| 404 |
|
| 405 |
[MISCELLANEOUS] |
| 406 |
|
| 407 |
# List of note tags to take in consideration, separated by a comma. |
| 408 |
notes=FIXME, |
| 409 |
XXX, |
| 410 |
TODO |
| 411 |
|
| 412 |
|
| 413 |
[SIMILARITIES] |
| 414 |
|
| 415 |
# Ignore comments when computing similarities. |
| 416 |
ignore-comments=yes |
| 417 |
|
| 418 |
# Ignore docstrings when computing similarities. |
| 419 |
ignore-docstrings=yes |
| 420 |
|
| 421 |
# Ignore imports when computing similarities. |
| 422 |
ignore-imports=no |
| 423 |
|
| 424 |
# Minimum lines number of a similarity. |
| 425 |
min-similarity-lines=4 |
| 426 |
|
| 427 |
|
| 428 |
[FORMAT] |
| 429 |
|
| 430 |
# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. |
| 431 |
expected-line-ending-format= |
| 432 |
|
| 433 |
# Regexp for a line that is allowed to be longer than the limit. |
| 434 |
ignore-long-lines=^\s*(# )?<?https?://\S+>?$ |
| 435 |
|
| 436 |
# Number of spaces of indent required inside a hanging or continued line. |
| 437 |
indent-after-paren=4 |
| 438 |
|
| 439 |
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 |
| 440 |
# tab). |
| 441 |
indent-string=' ' |
| 442 |
|
| 443 |
# Maximum number of characters on a single line. |
| 444 |
max-line-length=119 |
| 445 |
|
| 446 |
# Maximum number of lines in a module |
| 447 |
max-module-lines=1000 |
| 448 |
|
| 449 |
# Allow the body of a class to be on the same line as the declaration if body |
| 450 |
# contains single statement. |
| 451 |
single-line-class-stmt=no |
| 452 |
|
| 453 |
# Allow the body of an if to be on the same line as the test if there is no |
| 454 |
# else. |
| 455 |
single-line-if-stmt=no |
| 456 |
|
| 457 |
|
| 458 |
[IMPORTS] |
| 459 |
|
| 460 |
# Allow wildcard imports from modules that define __all__. |
| 461 |
allow-wildcard-with-all=no |
| 462 |
|
| 463 |
# Analyse import fallback blocks. This can be used to support both Python 2 and |
| 464 |
# 3 compatible code, which means that the block might have code that exists |
| 465 |
# only in one or another interpreter, leading to false positives when analysed. |
| 466 |
analyse-fallback-blocks=no |
| 467 |
|
| 468 |
# Deprecated modules which should not be used, separated by a comma |
| 469 |
deprecated-modules=optparse,tkinter.tix |
| 470 |
|
| 471 |
# Create a graph of external dependencies in the given file (report RP0402 must |
| 472 |
# not be disabled) |
| 473 |
ext-import-graph= |
| 474 |
|
| 475 |
# Create a graph of every (i.e. internal and external) dependencies in the |
| 476 |
# given file (report RP0402 must not be disabled) |
| 477 |
import-graph= |
| 478 |
|
| 479 |
# Create a graph of internal dependencies in the given file (report RP0402 must |
| 480 |
# not be disabled) |
| 481 |
int-import-graph= |
| 482 |
|
| 483 |
# Force import order to recognize a module as part of the standard |
| 484 |
# compatibility libraries. |
| 485 |
known-standard-library= |
| 486 |
|
| 487 |
# Force import order to recognize a module as part of a third party library. |
| 488 |
known-third-party=enchant |
| 489 |
|
| 490 |
|
| 491 |
[DESIGN] |
| 492 |
|
| 493 |
# Maximum number of arguments for function / method |
| 494 |
max-args=5 |
| 495 |
|
| 496 |
# Maximum number of attributes for a class (see R0902). |
| 497 |
max-attributes=7 |
| 498 |
|
| 499 |
# Maximum number of boolean expressions in a if statement |
| 500 |
max-bool-expr=5 |
| 501 |
|
| 502 |
# Maximum number of branch for function / method body |
| 503 |
max-branches=12 |
| 504 |
|
| 505 |
# Maximum number of locals for function / method body |
| 506 |
max-locals=15 |
| 507 |
|
| 508 |
# Maximum number of parents for a class (see R0901). |
| 509 |
max-parents=7 |
| 510 |
|
| 511 |
# Maximum number of public methods for a class (see R0904). |
| 512 |
max-public-methods=20 |
| 513 |
|
| 514 |
# Maximum number of return / yield for function / method body |
| 515 |
max-returns=6 |
| 516 |
|
| 517 |
# Maximum number of statements in function / method body |
| 518 |
max-statements=50 |
| 519 |
|
| 520 |
# Minimum number of public methods for a class (see R0903). |
| 521 |
min-public-methods=2 |
| 522 |
|
| 523 |
|
| 524 |
[CLASSES] |
| 525 |
|
| 526 |
# List of method names used to declare (i.e. assign) instance attributes. |
| 527 |
defining-attr-methods=__init__, |
| 528 |
__new__, |
| 529 |
setUp |
| 530 |
|
| 531 |
# List of member names, which should be excluded from the protected access |
| 532 |
# warning. |
| 533 |
exclude-protected=_asdict, |
| 534 |
_fields, |
| 535 |
_replace, |
| 536 |
_source, |
| 537 |
_make |
| 538 |
|
| 539 |
# List of valid names for the first argument in a class method. |
| 540 |
valid-classmethod-first-arg=cls |
| 541 |
|
| 542 |
# List of valid names for the first argument in a metaclass class method. |
| 543 |
valid-metaclass-classmethod-first-arg=mcs |
| 544 |
|
| 545 |
|
| 546 |
[EXCEPTIONS] |
| 547 |
|
| 548 |
# Exceptions that will emit a warning when being caught. Defaults to |
| 549 |
# "Exception" |
| 550 |
overgeneral-exceptions=Exception |