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