tests/functional: Add a pylintrc file

Add a pylintrc file that can be used for checking the python code of
the functional tests. For the beginning, we use some rather lax settings.
We still can refine them later if we think that there's a need for it.

Message-Id: <20251119082636.43286-2-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
Thomas Huth
2025-10-24 14:14:40 +02:00
parent b254e48624
commit 4e53727537
2 changed files with 85 additions and 0 deletions

View File

@@ -4461,6 +4461,7 @@ F: docs/devel/testing/functional.rst
F: scripts/clean_functional_cache.py
F: tests/functional/meson.build
F: tests/functional/generic/meson.build
F: tests/functional/pylintrc
F: tests/functional/qemu_test/
Windows Hosted Continuous Integration

84
tests/functional/pylintrc Normal file
View File

@@ -0,0 +1,84 @@
# Config file for checking the functional tests with pylint
#
# SPDX-License-Identifier: GPL-2.0-or-later
[DESIGN]
# Maximum number of arguments for function / method.
max-args=9
# Maximum number of attributes for a class (see R0902).
max-attributes=7
# Maximum number of boolean expressions in an if statement (see R0916).
max-bool-expr=5
# Maximum number of branch for function / method body.
max-branches=12
# Maximum number of locals for function / method body.
max-locals=15
# Maximum number of parents for a class (see R0901).
max-parents=7
# Maximum number of positional arguments for function / method.
max-positional-arguments=7
# Maximum number of public methods for a class (see R0904).
max-public-methods=20
# Maximum number of return / yield for function / method body.
max-returns=6
# Maximum number of statements in function / method body.
max-statements=50
# Minimum number of public methods for a class (see R0903).
min-public-methods=2
[MESSAGES CONTROL]
# Only show warnings with the listed confidence levels. Leave empty to show
# all. Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE,
# UNDEFINED.
confidence=HIGH,
CONTROL_FLOW,
INFERENCE,
INFERENCE_FAILURE
# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once). You can also use "--disable=all" to
# disable everything first and then re-enable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use "--disable=all --enable=classes
# --disable=W".
disable=bad-inline-option,
consider-using-f-string,
file-ignored,
fixme,
import-outside-toplevel,
locally-disabled,
logging-fstring-interpolation,
logging-not-lazy,
missing-function-docstring,
missing-module-docstring,
missing-class-docstring,
raw-checker-failed,
suppressed-message,
too-many-locals,
too-many-statements,
use-implicit-booleaness-not-comparison-to-string,
use-implicit-booleaness-not-comparison-to-zero,
use-symbolic-message-instead,
useless-suppression,
[SIMILARITIES]
# Minimum lines number of a similarity.
min-similarity-lines=20