]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/.pylintrc
update ceph source to reef 18.2.0
[ceph.git] / ceph / src / pybind / mgr / .pylintrc
1 [MASTER]
2
3 # A comma-separated list of package or module names from where C extensions may
4 # be loaded. Extensions are loading into the active Python interpreter and may
5 # run arbitrary code.
6 extension-pkg-whitelist=
7
8 # Specify a score threshold to be exceeded before program exits with error.
9 fail-under=10.0
10
11 # Add files or directories to the blacklist. They should be base names, not
12 # paths.
13 ignore=CVS
14
15 # Add files or directories matching the regex patterns to the blacklist. The
16 # regex matches against base names, not paths.
17 ignore-patterns=
18
19 # Python code to execute, usually for sys.path manipulation such as
20 # pygtk.require().
21 #init-hook=
22
23 # Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the
24 # number of processors available to use.
25 jobs=1
26
27 # Control the amount of potential inferred values when inferring a single
28 # object. This can help the performance when dealing with large functions or
29 # complex, nested conditions.
30 limit-inference-results=100
31
32 # List of plugins (as comma separated values of python module names) to load,
33 # usually to register additional checkers.
34 load-plugins=
35
36 # Pickle collected data for later comparisons.
37 persistent=yes
38
39 # When enabled, pylint would attempt to guess common misconfiguration and emit
40 # user-friendly hints instead of false-positive error messages.
41 suggestion-mode=yes
42
43 # Allow loading of arbitrary C extensions. Extensions are imported into the
44 # active Python interpreter and may run arbitrary code.
45 unsafe-load-any-extension=no
46
47
48 [MESSAGES CONTROL]
49
50 # Only show warnings with the listed confidence levels. Leave empty to show
51 # all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED.
52 confidence=
53
54 # Disable the message, report, category or checker with the given id(s). You
55 # can either give multiple identifiers separated by comma (,) or put this
56 # option multiple times (only on the command line, not in the configuration
57 # file where it should appear only once). You can also use "--disable=all" to
58 # disable everything first and then reenable specific checks. For example, if
59 # you want to run only the similarities checker, you can use "--disable=all
60 # --enable=similarities". If you want to run only the classes checker, but have
61 # no Warning level messages displayed, use "--disable=all --enable=classes
62 # --disable=W".
63 disable=print-statement,
64 parameter-unpacking,
65 unpacking-in-except,
66 old-raise-syntax,
67 backtick,
68 long-suffix,
69 old-ne-operator,
70 old-octal-literal,
71 import-star-module-level,
72 non-ascii-bytes-literal,
73 raw-checker-failed,
74 bad-inline-option,
75 locally-disabled,
76 file-ignored,
77 suppressed-message,
78 useless-suppression,
79 deprecated-pragma,
80 use-symbolic-message-instead,
81 apply-builtin,
82 basestring-builtin,
83 buffer-builtin,
84 cmp-builtin,
85 coerce-builtin,
86 execfile-builtin,
87 file-builtin,
88 long-builtin,
89 raw_input-builtin,
90 reduce-builtin,
91 standarderror-builtin,
92 unicode-builtin,
93 xrange-builtin,
94 coerce-method,
95 delslice-method,
96 getslice-method,
97 setslice-method,
98 no-absolute-import,
99 old-division,
100 dict-iter-method,
101 dict-view-method,
102 next-method-called,
103 metaclass-assignment,
104 indexing-exception,
105 raising-string,
106 reload-builtin,
107 oct-method,
108 hex-method,
109 nonzero-method,
110 cmp-method,
111 input-builtin,
112 round-builtin,
113 intern-builtin,
114 unichr-builtin,
115 map-builtin-not-iterating,
116 zip-builtin-not-iterating,
117 range-builtin-not-iterating,
118 filter-builtin-not-iterating,
119 using-cmp-argument,
120 eq-without-hash,
121 div-method,
122 idiv-method,
123 rdiv-method,
124 exception-message-attribute,
125 invalid-str-codec,
126 sys-max-int,
127 bad-python3-import,
128 deprecated-string-function,
129 deprecated-str-translate-call,
130 deprecated-itertools-function,
131 deprecated-types-field,
132 next-method-defined,
133 dict-items-not-iterating,
134 dict-keys-not-iterating,
135 dict-values-not-iterating,
136 deprecated-operator-function,
137 deprecated-urllib-function,
138 xreadlines-attribute,
139 deprecated-sys-function,
140 exception-escape,
141 comprehension-escape
142
143 # Enable the message, report, category or checker with the given id(s). You can
144 # either give multiple identifier separated by comma (,) or put this option
145 # multiple time (only on the command line, not in the configuration file where
146 # it should appear only once). See also the "--disable" option for examples.
147 enable=c-extension-no-member
148
149
150 [REPORTS]
151
152 # Python expression which should return a score less than or equal to 10. You
153 # have access to the variables 'error', 'warning', 'refactor', and 'convention'
154 # which contain the number of messages in each category, as well as 'statement'
155 # which is the total number of statements analyzed. This score is used by the
156 # global evaluation report (RP0004).
157 evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
158
159 # Template used to display messages. This is a python new-style format string
160 # used to format the message information. See doc for all details.
161 #msg-template=
162
163 # Set the output format. Available formats are text, parseable, colorized, json
164 # and msvs (visual studio). You can also give a reporter class, e.g.
165 # mypackage.mymodule.MyReporterClass.
166 output-format=text
167
168 # Tells whether to display a full report or only the messages.
169 reports=no
170
171 # Activate the evaluation score.
172 score=yes
173
174
175 [REFACTORING]
176
177 # Maximum number of nested blocks for function / method body
178 max-nested-blocks=5
179
180 # Complete name of functions that never returns. When checking for
181 # inconsistent-return-statements if a never returning function is called then
182 # it will be considered as an explicit return statement and no message will be
183 # printed.
184 never-returning-functions=sys.exit
185
186
187 [BASIC]
188
189 # Naming style matching correct argument names.
190 argument-naming-style=snake_case
191
192 # Regular expression matching correct argument names. Overrides argument-
193 # naming-style.
194 #argument-rgx=
195
196 # Naming style matching correct attribute names.
197 attr-naming-style=snake_case
198
199 # Regular expression matching correct attribute names. Overrides attr-naming-
200 # style.
201 #attr-rgx=
202
203 # Bad variable names which should always be refused, separated by a comma.
204 bad-names=foo,
205 bar,
206 baz,
207 toto,
208 tutu,
209 tata
210
211 # Bad variable names regexes, separated by a comma. If names match any regex,
212 # they will always be refused
213 bad-names-rgxs=
214
215 # Naming style matching correct class attribute names.
216 class-attribute-naming-style=any
217
218 # Regular expression matching correct class attribute names. Overrides class-
219 # attribute-naming-style.
220 #class-attribute-rgx=
221
222 # Naming style matching correct class names.
223 class-naming-style=PascalCase
224
225 # Regular expression matching correct class names. Overrides class-naming-
226 # style.
227 #class-rgx=
228
229 # Naming style matching correct constant names.
230 const-naming-style=UPPER_CASE
231
232 # Regular expression matching correct constant names. Overrides const-naming-
233 # style.
234 #const-rgx=
235
236 # Minimum line length for functions/classes that require docstrings, shorter
237 # ones are exempt.
238 docstring-min-length=-1
239
240 # Naming style matching correct function names.
241 function-naming-style=snake_case
242
243 # Regular expression matching correct function names. Overrides function-
244 # naming-style.
245 #function-rgx=
246
247 # Good variable names which should always be accepted, separated by a comma.
248 good-names=i,
249 j,
250 k,
251 ex,
252 Run,
253 _
254
255 # Good variable names regexes, separated by a comma. If names match any regex,
256 # they will always be accepted
257 good-names-rgxs=
258
259 # Include a hint for the correct naming format with invalid-name.
260 include-naming-hint=no
261
262 # Naming style matching correct inline iteration names.
263 inlinevar-naming-style=any
264
265 # Regular expression matching correct inline iteration names. Overrides
266 # inlinevar-naming-style.
267 #inlinevar-rgx=
268
269 # Naming style matching correct method names.
270 method-naming-style=snake_case
271
272 # Regular expression matching correct method names. Overrides method-naming-
273 # style.
274 #method-rgx=
275
276 # Naming style matching correct module names.
277 module-naming-style=snake_case
278
279 # Regular expression matching correct module names. Overrides module-naming-
280 # style.
281 #module-rgx=
282
283 # Colon-delimited sets of names that determine each other's naming style when
284 # the name regexes allow several styles.
285 name-group=
286
287 # Regular expression which should only match function or class names that do
288 # not require a docstring.
289 no-docstring-rgx=^_
290
291 # List of decorators that produce properties, such as abc.abstractproperty. Add
292 # to this list to register other decorators that produce valid properties.
293 # These decorators are taken in consideration only for invalid-name.
294 property-classes=abc.abstractproperty
295
296 # Naming style matching correct variable names.
297 variable-naming-style=snake_case
298
299 # Regular expression matching correct variable names. Overrides variable-
300 # naming-style.
301 #variable-rgx=
302
303
304 [FORMAT]
305
306 # Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
307 expected-line-ending-format=
308
309 # Regexp for a line that is allowed to be longer than the limit.
310 ignore-long-lines=^\s*(# )?<?https?://\S+>?$
311
312 # Number of spaces of indent required inside a hanging or continued line.
313 indent-after-paren=4
314
315 # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
316 # tab).
317 indent-string=' '
318
319 # Maximum number of characters on a single line.
320 max-line-length=100
321
322 # Maximum number of lines in a module.
323 max-module-lines=1000
324
325 # Allow the body of a class to be on the same line as the declaration if body
326 # contains single statement.
327 single-line-class-stmt=no
328
329 # Allow the body of an if to be on the same line as the test if there is no
330 # else.
331 single-line-if-stmt=no
332
333
334 [LOGGING]
335
336 # The type of string formatting that logging methods do. `old` means using %
337 # formatting, `new` is for `{}` formatting.
338 logging-format-style=old
339
340 # Logging modules to check that the string format arguments are in logging
341 # function parameter format.
342 logging-modules=logging
343
344
345 [MISCELLANEOUS]
346
347 # List of note tags to take in consideration, separated by a comma.
348 notes=FIXME,
349 XXX,
350 TODO
351
352 # Regular expression of note tags to take in consideration.
353 #notes-rgx=
354
355
356 [SIMILARITIES]
357
358 # Ignore comments when computing similarities.
359 ignore-comments=yes
360
361 # Ignore docstrings when computing similarities.
362 ignore-docstrings=yes
363
364 # Ignore imports when computing similarities.
365 ignore-imports=no
366
367 # Minimum lines number of a similarity.
368 min-similarity-lines=4
369
370
371 [SPELLING]
372
373 # Limits count of emitted suggestions for spelling mistakes.
374 max-spelling-suggestions=4
375
376 # Spelling dictionary name. Available dictionaries: en_AG (hunspell), en_AU
377 # (hunspell), en_BS (hunspell), en_BW (hunspell), en_BZ (hunspell), en_CA
378 # (hunspell), en_DK (hunspell), en_GB (hunspell), en_GH (hunspell), en_HK
379 # (hunspell), en_IE (hunspell), en_IN (hunspell), en_JM (hunspell), en_MW
380 # (hunspell), en_NA (hunspell), en_NG (hunspell), en_NZ (hunspell), en_PH
381 # (hunspell), en_SG (hunspell), en_TT (hunspell), en_US (hunspell), en_ZA
382 # (hunspell), en_ZM (hunspell), en_ZW (hunspell).
383 spelling-dict=
384
385 # List of comma separated words that should not be checked.
386 spelling-ignore-words=
387
388 # A path to a file that contains the private dictionary; one word per line.
389 spelling-private-dict-file=
390
391 # Tells whether to store unknown words to the private dictionary (see the
392 # --spelling-private-dict-file option) instead of raising a message.
393 spelling-store-unknown-words=no
394
395
396 [STRING]
397
398 # This flag controls whether inconsistent-quotes generates a warning when the
399 # character used as a quote delimiter is used inconsistently within a module.
400 check-quote-consistency=no
401
402 # This flag controls whether the implicit-str-concat should generate a warning
403 # on implicit string concatenation in sequences defined over several lines.
404 check-str-concat-over-line-jumps=no
405
406
407 [TYPECHECK]
408
409 # List of decorators that produce context managers, such as
410 # contextlib.contextmanager. Add to this list to register other decorators that
411 # produce valid context managers.
412 contextmanager-decorators=contextlib.contextmanager
413
414 # List of members which are set dynamically and missed by pylint inference
415 # system, and so shouldn't trigger E1101 when accessed. Python regular
416 # expressions are accepted.
417 generated-members=
418
419 # Tells whether missing members accessed in mixin class should be ignored. A
420 # mixin class is detected if its name ends with "mixin" (case insensitive).
421 ignore-mixin-members=yes
422
423 # Tells whether to warn about missing members when the owner of the attribute
424 # is inferred to be None.
425 ignore-none=yes
426
427 # This flag controls whether pylint should warn about no-member and similar
428 # checks whenever an opaque object is returned when inferring. The inference
429 # can return multiple potential results while evaluating a Python object, but
430 # some branches might not be evaluated, which results in partial inference. In
431 # that case, it might be useful to still emit no-member and other checks for
432 # the rest of the inferred objects.
433 ignore-on-opaque-inference=yes
434
435 # List of class names for which member attributes should not be checked (useful
436 # for classes with dynamically set attributes). This supports the use of
437 # qualified names.
438 ignored-classes=optparse.Values,thread._local,_thread._local
439
440 # List of module names for which member attributes should not be checked
441 # (useful for modules/projects where namespaces are manipulated during runtime
442 # and thus existing member attributes cannot be deduced by static analysis). It
443 # supports qualified module names, as well as Unix pattern matching.
444 ignored-modules=
445
446 # Show a hint with possible names when a member name was not found. The aspect
447 # of finding the hint is based on edit distance.
448 missing-member-hint=yes
449
450 # The minimum edit distance a name should have in order to be considered a
451 # similar match for a missing member name.
452 missing-member-hint-distance=1
453
454 # The total number of similar names that should be taken in consideration when
455 # showing a hint for a missing member.
456 missing-member-max-choices=1
457
458 # List of decorators that change the signature of a decorated function.
459 signature-mutators=
460
461
462 [VARIABLES]
463
464 # List of additional names supposed to be defined in builtins. Remember that
465 # you should avoid defining new builtins when possible.
466 additional-builtins=
467
468 # Tells whether unused global variables should be treated as a violation.
469 allow-global-unused-variables=yes
470
471 # List of strings which can identify a callback function by name. A callback
472 # name must start or end with one of those strings.
473 callbacks=cb_,
474 _cb
475
476 # A regular expression matching the name of dummy variables (i.e. expected to
477 # not be used).
478 dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_
479
480 # Argument names that match this expression will be ignored. Default to name
481 # with leading underscore.
482 ignored-argument-names=_.*|^ignored_|^unused_
483
484 # Tells whether we should check for unused import in __init__ files.
485 init-import=no
486
487 # List of qualified module names which can have objects that can redefine
488 # builtins.
489 redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io
490
491
492 [CLASSES]
493
494 # List of method names used to declare (i.e. assign) instance attributes.
495 defining-attr-methods=__init__,
496 __new__,
497 setUp,
498 __post_init__
499
500 # List of member names, which should be excluded from the protected access
501 # warning.
502 exclude-protected=_asdict,
503 _fields,
504 _replace,
505 _source,
506 _make
507
508 # List of valid names for the first argument in a class method.
509 valid-classmethod-first-arg=cls
510
511 # List of valid names for the first argument in a metaclass class method.
512 valid-metaclass-classmethod-first-arg=cls
513
514
515 [DESIGN]
516
517 # Maximum number of arguments for function / method.
518 max-args=5
519
520 # Maximum number of attributes for a class (see R0902).
521 max-attributes=7
522
523 # Maximum number of boolean expressions in an if statement (see R0916).
524 max-bool-expr=5
525
526 # Maximum number of branch for function / method body.
527 max-branches=12
528
529 # Maximum number of locals for function / method body.
530 max-locals=15
531
532 # Maximum number of parents for a class (see R0901).
533 max-parents=7
534
535 # Maximum number of public methods for a class (see R0904).
536 max-public-methods=20
537
538 # Maximum number of return / yield for function / method body.
539 max-returns=6
540
541 # Maximum number of statements in function / method body.
542 max-statements=50
543
544 # Minimum number of public methods for a class (see R0903).
545 min-public-methods=2
546
547
548 [IMPORTS]
549
550 # List of modules that can be imported at any level, not just the top level
551 # one.
552 allow-any-import-level=
553
554 # Allow wildcard imports from modules that define __all__.
555 allow-wildcard-with-all=no
556
557 # Analyse import fallback blocks. This can be used to support both Python 2 and
558 # 3 compatible code, which means that the block might have code that exists
559 # only in one or another interpreter, leading to false positives when analysed.
560 analyse-fallback-blocks=no
561
562 # Deprecated modules which should not be used, separated by a comma.
563 deprecated-modules=optparse,tkinter.tix
564
565 # Create a graph of external dependencies in the given file (report RP0402 must
566 # not be disabled).
567 ext-import-graph=
568
569 # Create a graph of every (i.e. internal and external) dependencies in the
570 # given file (report RP0402 must not be disabled).
571 import-graph=
572
573 # Create a graph of internal dependencies in the given file (report RP0402 must
574 # not be disabled).
575 int-import-graph=
576
577 # Force import order to recognize a module as part of the standard
578 # compatibility libraries.
579 known-standard-library=
580
581 # Force import order to recognize a module as part of a third party library.
582 known-third-party=enchant
583
584 # Couples of modules and preferred modules, separated by a comma.
585 preferred-modules=
586
587
588 [EXCEPTIONS]
589
590 # Exceptions that will emit a warning when being caught. Defaults to
591 # "BaseException, Exception".
592 overgeneral-exceptions=BaseException,
593 Exception