From: Thomas Huth <thuth@redhat.com>
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.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
MAINTAINERS | 1 +
tests/functional/pylintrc | 80 +++++++++++++++++++++++++++++++++++++++
2 files changed, 81 insertions(+)
create mode 100644 tests/functional/pylintrc
diff --git a/MAINTAINERS b/MAINTAINERS
index 38325e0617c..3d8725b1c9a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4430,6 +4430,7 @@ R: Daniel P. Berrange <berrange@redhat.com>
S: Maintained
F: docs/devel/testing/functional.rst
F: scripts/clean_functional_cache.py
+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
index 00000000000..a396a8ceebd
--- /dev/null
+++ b/tests/functional/pylintrc
@@ -0,0 +1,80 @@
+[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
--
2.51.1