Debian Codegraph @

.pylintrc

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