]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
tests/functional: Add a pylintrc file
authorThomas Huth <thuth@redhat.com>
Fri, 24 Oct 2025 12:14:40 +0000 (14:14 +0200)
committerThomas Huth <thuth@redhat.com>
Mon, 12 Jan 2026 12:53:32 +0000 (13:53 +0100)
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>
MAINTAINERS
tests/functional/pylintrc [new file with mode: 0644]

index 3a46c7fd0b00db5264d0ed620708523623896289..a6168cb46f73f4f745a608cd8367f083410122e1 100644 (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
diff --git a/tests/functional/pylintrc b/tests/functional/pylintrc
new file mode 100644 (file)
index 0000000..049c3e7
--- /dev/null
@@ -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