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