blob: 2f339b1989ebc62a5427c7e8df5f2c3b2ae8ba6f [file] [log] [blame]
Richard Burtoncefc7e12023-12-06 17:13:10 +00001# SPDX-FileCopyrightText: Copyright 2023-2024 Arm Limited and/or its affiliates <open-source-office@arm.com>
Alex Tawsedaba3cf2023-09-29 15:55:38 +01002# SPDX-License-Identifier: Apache-2.0
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16[MAIN]
17
18# Analyse import fallback blocks. This can be used to support both Python 2 and
19# 3 compatible code, which means that the block might have code that exists
20# only in one or another interpreter, leading to false positives when analysed.
21analyse-fallback-blocks=no
22
23# Clear in-memory caches upon conclusion of linting. Useful if running pylint
24# in a server-like mode.
25clear-cache-post-run=no
26
27# Load and enable all available extensions. Use --list-extensions to see a list
28# all available extensions.
29#enable-all-extensions=
30
31# In error mode, messages with a category besides ERROR or FATAL are
32# suppressed, and no reports are done by default. Error mode is compatible with
33# disabling specific errors.
34#errors-only=
35
36# Always return a 0 (non-error) status code, even if lint errors are found.
37# This is primarily useful in continuous integration scripts.
38#exit-zero=
39
40# A comma-separated list of package or module names from where C extensions may
41# be loaded. Extensions are loading into the active Python interpreter and may
42# run arbitrary code.
43extension-pkg-allow-list=
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. (This is an alternative name to extension-pkg-allow-list
48# for backward compatibility.)
49extension-pkg-whitelist=
50
51# Return non-zero exit code if any of these messages/categories are detected,
52# even if score is above --fail-under value. Syntax same as enable. Messages
53# specified are enabled, while categories only check already-enabled messages.
54fail-on=
55
56# Specify a score threshold under which the program will exit with error.
57fail-under=10.0
58
59# Interpret the stdin as a python script, whose filename needs to be passed as
60# the module_or_package argument.
61#from-stdin=
62
63# Files or directories to be skipped. They should be base names, not paths.
64ignore=CVS
65
66# Add files or directories matching the regular expressions patterns to the
67# ignore-list. The regex matches against paths and can be in Posix or Windows
68# format. Because '\\' represents the directory delimiter on Windows systems,
69# it can't be used as an escape character.
Richard Burtoncefc7e12023-12-06 17:13:10 +000070ignore-paths=^dependencies/.*$,
71 ^resources_downloaded/.*$,
72 ^scripts/py/vsi/.*$
Alex Tawsedaba3cf2023-09-29 15:55:38 +010073
74# Files or directories matching the regular expression patterns are skipped.
75# The regex matches against base names, not paths. The default value ignores
76# Emacs file locks
77ignore-patterns=^\.#
78
79# List of module names for which member attributes should not be checked
80# (useful for modules/projects where namespaces are manipulated during runtime
81# and thus existing member attributes cannot be deduced by static analysis). It
82# supports qualified module names, as well as Unix pattern matching.
83ignored-modules=
84
85# Python code to execute, usually for sys.path manipulation such as
86# pygtk.require().
87#init-hook=
88
89# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the
90# number of processors available to use, and will cap the count on Windows to
91# avoid hangs.
92jobs=1
93
94# Control the amount of potential inferred values when inferring a single
95# object. This can help the performance when dealing with large functions or
96# complex, nested conditions.
97limit-inference-results=100
98
99# List of plugins (as comma separated values of python module names) to load,
100# usually to register additional checkers.
101load-plugins=
102
103# Pickle collected data for later comparisons.
104persistent=yes
105
106# Minimum Python version to use for version dependent checks. Will default to
107# the version used to run pylint.
108py-version=3.9
109
110# Discover python modules and packages in the file system subtree.
111recursive=no
112
113# Add paths to the list of the source roots. Supports globbing patterns. The
114# source root is an absolute path or a path relative to the current working
115# directory used to determine a package namespace for modules located under the
116# source root.
117source-roots=
118
119# When enabled, pylint would attempt to guess common misconfiguration and emit
120# user-friendly hints instead of false-positive error messages.
121suggestion-mode=yes
122
123# Allow loading of arbitrary C extensions. Extensions are imported into the
124# active Python interpreter and may run arbitrary code.
125unsafe-load-any-extension=no
126
127# In verbose mode, extra non-checker-related info will be displayed.
128#verbose=
129
130
131[BASIC]
132
133# Naming style matching correct argument names.
134argument-naming-style=snake_case
135
136# Regular expression matching correct argument names. Overrides argument-
137# naming-style. If left empty, argument names will be checked with the set
138# naming style.
139#argument-rgx=
140
141# Naming style matching correct attribute names.
142attr-naming-style=snake_case
143
144# Regular expression matching correct attribute names. Overrides attr-naming-
145# style. If left empty, attribute names will be checked with the set naming
146# style.
147#attr-rgx=
148
149# Bad variable names which should always be refused, separated by a comma.
150bad-names=foo,
151 bar,
152 baz,
153 toto,
154 tutu,
155 tata
156
157# Bad variable names regexes, separated by a comma. If names match any regex,
158# they will always be refused
159bad-names-rgxs=
160
161# Naming style matching correct class attribute names.
162class-attribute-naming-style=any
163
164# Regular expression matching correct class attribute names. Overrides class-
165# attribute-naming-style. If left empty, class attribute names will be checked
166# with the set naming style.
167#class-attribute-rgx=
168
169# Naming style matching correct class constant names.
170class-const-naming-style=UPPER_CASE
171
172# Regular expression matching correct class constant names. Overrides class-
173# const-naming-style. If left empty, class constant names will be checked with
174# the set naming style.
175#class-const-rgx=
176
177# Naming style matching correct class names.
178class-naming-style=PascalCase
179
180# Regular expression matching correct class names. Overrides class-naming-
181# style. If left empty, class names will be checked with the set naming style.
182#class-rgx=
183
184# Naming style matching correct constant names.
185const-naming-style=UPPER_CASE
186
187# Regular expression matching correct constant names. Overrides const-naming-
188# style. If left empty, constant names will be checked with the set naming
189# style.
190#const-rgx=
191
192# Minimum line length for functions/classes that require docstrings, shorter
193# ones are exempt.
194docstring-min-length=-1
195
196# Naming style matching correct function names.
197function-naming-style=snake_case
198
199# Regular expression matching correct function names. Overrides function-
200# naming-style. If left empty, function names will be checked with the set
201# naming style.
202#function-rgx=
203
204# Good variable names which should always be accepted, separated by a comma.
205good-names=i,
206 j,
207 k,
208 f,
209 g,
210 x,
211 y,
212 ex,
213 Run,
214 _
215
216# Good variable names regexes, separated by a comma. If names match any regex,
217# they will always be accepted
218good-names-rgxs=
219
220# Include a hint for the correct naming format with invalid-name.
221include-naming-hint=no
222
223# Naming style matching correct inline iteration names.
224inlinevar-naming-style=any
225
226# Regular expression matching correct inline iteration names. Overrides
227# inlinevar-naming-style. If left empty, inline iteration names will be checked
228# with the set naming style.
229#inlinevar-rgx=
230
231# Naming style matching correct method names.
232method-naming-style=snake_case
233
234# Regular expression matching correct method names. Overrides method-naming-
235# style. If left empty, method names will be checked with the set naming style.
236#method-rgx=
237
238# Naming style matching correct module names.
239module-naming-style=snake_case
240
241# Regular expression matching correct module names. Overrides module-naming-
242# style. If left empty, module names will be checked with the set naming style.
243#module-rgx=
244
245# Colon-delimited sets of names that determine each other's naming style when
246# the name regexes allow several styles.
247name-group=
248
249# Regular expression which should only match function or class names that do
250# not require a docstring.
251no-docstring-rgx=^_
252
253# List of decorators that produce properties, such as abc.abstractproperty. Add
254# to this list to register other decorators that produce valid properties.
255# These decorators are taken in consideration only for invalid-name.
256property-classes=abc.abstractproperty
257
258# Regular expression matching correct type alias names. If left empty, type
259# alias names will be checked with the set naming style.
260#typealias-rgx=
261
262# Regular expression matching correct type variable names. If left empty, type
263# variable names will be checked with the set naming style.
264#typevar-rgx=
265
266# Naming style matching correct variable names.
267variable-naming-style=snake_case
268
269# Regular expression matching correct variable names. Overrides variable-
270# naming-style. If left empty, variable names will be checked with the set
271# naming style.
272#variable-rgx=
273
274
275[CLASSES]
276
277# Warn about protected attribute access inside special methods
278check-protected-access-in-special-methods=no
279
280# List of method names used to declare (i.e. assign) instance attributes.
281defining-attr-methods=__init__,
282 __new__,
283 setUp,
284 asyncSetUp,
285 __post_init__
286
287# List of member names, which should be excluded from the protected access
288# warning.
289exclude-protected=_asdict,_fields,_replace,_source,_make,os._exit
290
291# List of valid names for the first argument in a class method.
292valid-classmethod-first-arg=cls
293
294# List of valid names for the first argument in a metaclass class method.
295valid-metaclass-classmethod-first-arg=mcs
296
297
298[DESIGN]
299
300# List of regular expressions of class ancestor names to ignore when counting
301# public methods (see R0903)
302exclude-too-few-public-methods=
303
304# List of qualified class names to ignore when counting class parents (see
305# R0901)
306ignored-parents=
307
308# Maximum number of arguments for function / method.
309max-args=5
310
311# Maximum number of attributes for a class (see R0902).
312max-attributes=7
313
314# Maximum number of boolean expressions in an if statement (see R0916).
315max-bool-expr=5
316
317# Maximum number of branch for function / method body.
318max-branches=12
319
320# Maximum number of locals for function / method body.
321max-locals=15
322
323# Maximum number of parents for a class (see R0901).
324max-parents=7
325
326# Maximum number of public methods for a class (see R0904).
327max-public-methods=20
328
329# Maximum number of return / yield for function / method body.
330max-returns=6
331
332# Maximum number of statements in function / method body.
333max-statements=50
334
335# Minimum number of public methods for a class (see R0903).
336min-public-methods=2
337
338
339[EXCEPTIONS]
340
341# Exceptions that will emit a warning when caught.
342overgeneral-exceptions=builtins.BaseException,builtins.Exception
343
344
345[FORMAT]
346
347# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
348expected-line-ending-format=
349
350# Regexp for a line that is allowed to be longer than the limit.
351ignore-long-lines=^\s*(# )?<?https?://\S+>?$|^# SPDX-FileCopyrightText.*$
352
353# Number of spaces of indent required inside a hanging or continued line.
354indent-after-paren=4
355
356# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
357# tab).
358indent-string=' '
359
360# Maximum number of characters on a single line.
361max-line-length=100
362
363# Maximum number of lines in a module.
364max-module-lines=1000
365
366# Allow the body of a class to be on the same line as the declaration if body
367# contains single statement.
368single-line-class-stmt=no
369
370# Allow the body of an if to be on the same line as the test if there is no
371# else.
372single-line-if-stmt=no
373
374
375[IMPORTS]
376
377# List of modules that can be imported at any level, not just the top level
378# one.
379allow-any-import-level=
380
381# Allow explicit reexports by alias from a package __init__.
382allow-reexport-from-package=no
383
384# Allow wildcard imports from modules that define __all__.
385allow-wildcard-with-all=no
386
387# Deprecated modules which should not be used, separated by a comma.
388deprecated-modules=
389
390# Output a graph (.gv or any supported image format) of external dependencies
391# to the given file (report RP0402 must not be disabled).
392ext-import-graph=
393
394# Output a graph (.gv or any supported image format) of all (i.e. internal and
395# external) dependencies to the given file (report RP0402 must not be
396# disabled).
397import-graph=
398
399# Output a graph (.gv or any supported image format) of internal dependencies
400# to the given file (report RP0402 must not be disabled).
401int-import-graph=
402
403# Force import order to recognize a module as part of the standard
404# compatibility libraries.
405known-standard-library=
406
407# Force import order to recognize a module as part of a third party library.
408known-third-party=enchant
409
410# Couples of modules and preferred modules, separated by a comma.
411preferred-modules=
412
413
414[LOGGING]
415
416# The type of string formatting that logging methods do. `old` means using %
417# formatting, `new` is for `{}` formatting.
418logging-format-style=old
419
420# Logging modules to check that the string format arguments are in logging
421# function parameter format.
422logging-modules=logging
423
424
425[MESSAGES CONTROL]
426
427# Only show warnings with the listed confidence levels. Leave empty to show
428# all. Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE,
429# UNDEFINED.
430confidence=HIGH,
431 CONTROL_FLOW,
432 INFERENCE,
433 INFERENCE_FAILURE,
434 UNDEFINED
435
436# Disable the message, report, category or checker with the given id(s). You
437# can either give multiple identifiers separated by comma (,) or put this
438# option multiple times (only on the command line, not in the configuration
439# file where it should appear only once). You can also use "--disable=all" to
440# disable everything first and then re-enable specific checks. For example, if
441# you want to run only the similarities checker, you can use "--disable=all
442# --enable=similarities". If you want to run only the classes checker, but have
443# no Warning level messages displayed, use "--disable=all --enable=classes
444# --disable=W".
445disable=raw-checker-failed,
446 bad-inline-option,
447 locally-disabled,
448 file-ignored,
449 suppressed-message,
450 useless-suppression,
451 deprecated-pragma,
452 use-implicit-booleaness-not-comparison-to-string,
453 use-implicit-booleaness-not-comparison-to-zero,
454 use-symbolic-message-instead
455
456# Enable the message, report, category or checker with the given id(s). You can
457# either give multiple identifier separated by comma (,) or put this option
458# multiple time (only on the command line, not in the configuration file where
459# it should appear only once). See also the "--disable" option for examples.
460enable=
461
462
463[METHOD_ARGS]
464
465# List of qualified names (i.e., library.method) which require a timeout
466# parameter e.g. 'requests.api.get,requests.api.post'
467timeout-methods=requests.api.delete,requests.api.get,requests.api.head,requests.api.options,requests.api.patch,requests.api.post,requests.api.put,requests.api.request
468
469
470[MISCELLANEOUS]
471
472# List of note tags to take in consideration, separated by a comma.
473notes=FIXME,
474 XXX,
475 TODO
476
477# Regular expression of note tags to take in consideration.
478notes-rgx=
479
480
481[REFACTORING]
482
483# Maximum number of nested blocks for function / method body
484max-nested-blocks=5
485
486# Complete name of functions that never returns. When checking for
487# inconsistent-return-statements if a never returning function is called then
488# it will be considered as an explicit return statement and no message will be
489# printed.
490never-returning-functions=sys.exit,argparse.parse_error
491
492
493[REPORTS]
494
495# Python expression which should return a score less than or equal to 10. You
496# have access to the variables 'fatal', 'error', 'warning', 'refactor',
497# 'convention', and 'info' which contain the number of messages in each
498# category, as well as 'statement' which is the total number of statements
499# analyzed. This score is used by the global evaluation report (RP0004).
500evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10))
501
502# Template used to display messages. This is a python new-style format string
503# used to format the message information. See doc for all details.
504msg-template=
505
506# Set the output format. Available formats are: text, parseable, colorized,
507# json2 (improved json format), json (old json format) and msvs (visual
508# studio). You can also give a reporter class, e.g.
509# mypackage.mymodule.MyReporterClass.
510#output-format=
511
512# Tells whether to display a full report or only the messages.
513reports=no
514
515# Activate the evaluation score.
516score=yes
517
518
519[SIMILARITIES]
520
521# Comments are removed from the similarity computation
522ignore-comments=yes
523
524# Docstrings are removed from the similarity computation
525ignore-docstrings=yes
526
527# Imports are removed from the similarity computation
528ignore-imports=yes
529
530# Signatures are removed from the similarity computation
531ignore-signatures=yes
532
533# Minimum lines number of a similarity.
534min-similarity-lines=4
535
536
537[SPELLING]
538
539# Limits count of emitted suggestions for spelling mistakes.
540max-spelling-suggestions=4
541
542# Spelling dictionary name. No available dictionaries : You need to install
543# both the python package and the system dependency for enchant to work.
544spelling-dict=
545
546# List of comma separated words that should be considered directives if they
547# appear at the beginning of a comment and should not be checked.
548spelling-ignore-comment-directives=fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy:
549
550# List of comma separated words that should not be checked.
551spelling-ignore-words=
552
553# A path to a file that contains the private dictionary; one word per line.
554spelling-private-dict-file=
555
556# Tells whether to store unknown words to the private dictionary (see the
557# --spelling-private-dict-file option) instead of raising a message.
558spelling-store-unknown-words=no
559
560
561[STRING]
562
563# This flag controls whether inconsistent-quotes generates a warning when the
564# character used as a quote delimiter is used inconsistently within a module.
565check-quote-consistency=no
566
567# This flag controls whether the implicit-str-concat should generate a warning
568# on implicit string concatenation in sequences defined over several lines.
569check-str-concat-over-line-jumps=no
570
571
572[TYPECHECK]
573
574# List of decorators that produce context managers, such as
575# contextlib.contextmanager. Add to this list to register other decorators that
576# produce valid context managers.
577contextmanager-decorators=contextlib.contextmanager
578
579# List of members which are set dynamically and missed by pylint inference
580# system, and so shouldn't trigger E1101 when accessed. Python regular
581# expressions are accepted.
582generated-members=
583
584# Tells whether to warn about missing members when the owner of the attribute
585# is inferred to be None.
586ignore-none=yes
587
588# This flag controls whether pylint should warn about no-member and similar
589# checks whenever an opaque object is returned when inferring. The inference
590# can return multiple potential results while evaluating a Python object, but
591# some branches might not be evaluated, which results in partial inference. In
592# that case, it might be useful to still emit no-member and other checks for
593# the rest of the inferred objects.
594ignore-on-opaque-inference=yes
595
596# List of symbolic message names to ignore for Mixin members.
597ignored-checks-for-mixins=no-member,
598 not-async-context-manager,
599 not-context-manager,
600 attribute-defined-outside-init
601
602# List of class names for which member attributes should not be checked (useful
603# for classes with dynamically set attributes). This supports the use of
604# qualified names.
605ignored-classes=optparse.Values,thread._local,_thread._local,argparse.Namespace
606
607# Show a hint with possible names when a member name was not found. The aspect
608# of finding the hint is based on edit distance.
609missing-member-hint=yes
610
611# The minimum edit distance a name should have in order to be considered a
612# similar match for a missing member name.
613missing-member-hint-distance=1
614
615# The total number of similar names that should be taken in consideration when
616# showing a hint for a missing member.
617missing-member-max-choices=1
618
619# Regex pattern to define which classes are considered mixins.
620mixin-class-rgx=.*[Mm]ixin
621
622# List of decorators that change the signature of a decorated function.
623signature-mutators=
624
625
626[VARIABLES]
627
628# List of additional names supposed to be defined in builtins. Remember that
629# you should avoid defining new builtins when possible.
630additional-builtins=
631
632# Tells whether unused global variables should be treated as a violation.
633allow-global-unused-variables=yes
634
635# List of names allowed to shadow builtins
636allowed-redefined-builtins=
637
638# List of strings which can identify a callback function by name. A callback
639# name must start or end with one of those strings.
640callbacks=cb_,
641 _cb
642
643# A regular expression matching the name of dummy variables (i.e. expected to
644# not be used).
645dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_
646
647# Argument names that match this expression will be ignored.
648ignored-argument-names=_.*|^ignored_|^unused_
649
650# Tells whether we should check for unused import in __init__ files.
651init-import=no
652
653# List of qualified module names which can have objects that can redefine
654# builtins.
655redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io