[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 14/47] qapi: add pylintrc
From: |
John Snow |
Subject: |
[PATCH v3 14/47] qapi: add pylintrc |
Date: |
Thu, 24 Sep 2020 20:28:27 -0400 |
Using `pylint --generate-rcfile > pylintrc`, generate a skeleton
pylintrc file. Sections that are not presently relevant (by the end of
this series) are removed leaving just the empty section as a search
engine / documentation hint to future authors.
I am targeting pylint 2.6.0. In the future (and hopefully before 5.2 is
released), I aim to have gitlab CI running the specific targeted
versions of pylint, mypy, flake8, etc in a job.
2.5.x will work if you additionally pass --disable=bad-whitespace.
This warning was removed from 2.6.x, for lack of consistent support.
Right now, quite a few modules are ignored as they are known to fail as
of this commit. modules will be removed from the known-bad list
throughout this and following series as they are repaired.
Note: Normally, pylintrc would go in the folder above the module, but as
that folder is shared by many things, it is going inside the module
folder (for now). Due to a bug in pylint 2.5+, pylint does not
correctly recognize when it is being run from "inside" a package, and
must be run *outside* of the package.
Therefore, to run it, you must:
> pylint scripts/qapi/ --rcfile=scripts/qapi/pylintrc
Signed-off-by: John Snow <jsnow@redhat.com>
Tested-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Cleber Rosa <crosa@redhat.com>
Tested-by: Cleber Rosa <crosa@redhat.com>
---
scripts/qapi/pylintrc | 74 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 74 insertions(+)
create mode 100644 scripts/qapi/pylintrc
diff --git a/scripts/qapi/pylintrc b/scripts/qapi/pylintrc
new file mode 100644
index 0000000000..02dd22c863
--- /dev/null
+++ b/scripts/qapi/pylintrc
@@ -0,0 +1,74 @@
+[MASTER]
+
+# Add files or directories matching the regex patterns to the ignore list.
+# The regex matches against base names, not paths.
+ignore-patterns=common.py,
+ doc.py,
+ error.py,
+ expr.py,
+ gen.py,
+ parser.py,
+ schema.py,
+ source.py,
+ types.py,
+ visit.py,
+
+
+[MESSAGES CONTROL]
+
+# 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 reenable 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=fixme,
+ missing-docstring,
+ too-many-arguments,
+ too-many-branches,
+ too-many-statements,
+ too-many-instance-attributes,
+
+[REPORTS]
+
+[REFACTORING]
+
+[MISCELLANEOUS]
+
+[LOGGING]
+
+[BASIC]
+
+# Good variable names which should always be accepted, separated by a comma.
+good-names=i,
+ j,
+ k,
+ ex,
+ Run,
+ _
+
+[VARIABLES]
+
+[STRING]
+
+[SPELLING]
+
+[FORMAT]
+
+[SIMILARITIES]
+
+# Ignore import statements themselves when computing similarities.
+ignore-imports=yes
+
+[TYPECHECK]
+
+[CLASSES]
+
+[IMPORTS]
+
+[DESIGN]
+
+[EXCEPTIONS]
--
2.26.2
- Re: [PATCH v3 12/47] qapi: enforce import order/styling with isort, (continued)
- [PATCH v3 10/47] qapi: Prefer explicit relative imports, John Snow, 2020/09/24
- [PATCH v3 13/47] qapi: delint using flake8, John Snow, 2020/09/24
- [PATCH v3 05/47] qapi/doc.py: Change code templates from function to string, John Snow, 2020/09/24
- [PATCH v3 15/47] qapi/common.py: Remove python compatibility workaround, John Snow, 2020/09/24
- [PATCH v3 20/47] qapi/common.py: add type hint annotations, John Snow, 2020/09/24
- [PATCH v3 17/47] qapi/common.py: delint with pylint, John Snow, 2020/09/24
- [PATCH v3 14/47] qapi: add pylintrc,
John Snow <=
- [PATCH v3 24/47] qapi/events.py: add type hint annotations, John Snow, 2020/09/24
- [PATCH v3 19/47] qapi/common.py: check with pylint, John Snow, 2020/09/24
- [PATCH v3 23/47] qapi: establish mypy type-checking baseline, John Snow, 2020/09/24
- [PATCH v3 33/47] qapi/gen.py: Enable checking with mypy, John Snow, 2020/09/24
- [PATCH v3 25/47] qapi/events.py: Move comments into docstrings, John Snow, 2020/09/24
- [PATCH v3 16/47] qapi/common.py: Add indent manager, John Snow, 2020/09/24
- [PATCH v3 22/47] qapi/common.py: move build_params into gen.py, John Snow, 2020/09/24
- [PATCH v3 35/47] qapi/gen.py: update write() to be more idiomatic, John Snow, 2020/09/24
- [PATCH v3 27/47] qapi/commands.py: add type hint annotations, John Snow, 2020/09/24