docs/qapidoc: linting fixes

This restores the linting baseline in qapidoc. The order of some imports
change slightly here due to configuring isort a little better:
previously, isort was having difficulty understanding that "compat" and
"qapidoc_legacy" were local modules because docs/sphinx "isn't a python
package". Configuring this manually, isort chooses a different import
ordering, which _is_ intentional here.

Also: extra ignores are added for pylint. The most recent versions of
pylint don't require these ignores, but the oldest versions we support
do, so in the extra ignores go.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-id: 20250604200354.459501-3-jsnow@redhat.com
This commit is contained in:
John Snow 2025-06-04 16:03:50 -04:00
parent dc955052b4
commit a738817c1d
2 changed files with 17 additions and 13 deletions

View file

@ -20,16 +20,6 @@ from typing import (
from docutils import nodes
from docutils.parsers.rst import directives
from compat import (
CompatField,
CompatGroupedField,
CompatTypedField,
KeywordNode,
ParserFix,
Signature,
SpaceNode,
)
from sphinx import addnodes
from sphinx.directives import ObjectDescription
from sphinx.domains import (
@ -44,6 +34,16 @@ from sphinx.util import logging
from sphinx.util.docutils import SphinxDirective
from sphinx.util.nodes import make_id, make_refnode
from compat import (
CompatField,
CompatGroupedField,
CompatTypedField,
KeywordNode,
ParserFix,
Signature,
SpaceNode,
)
if TYPE_CHECKING:
from typing import (
@ -56,7 +56,6 @@ if TYPE_CHECKING:
)
from docutils.nodes import Element, Node
from sphinx.addnodes import desc_signature, pending_xref
from sphinx.application import Sphinx
from sphinx.builders import Builder
@ -168,6 +167,8 @@ class QAPIDescription(ParserFix):
"""
def handle_signature(self, sig: str, signode: desc_signature) -> Signature:
# pylint: disable=unused-argument
# Do nothing. The return value here is the "name" of the entity
# being documented; for QAPI, this is the same as the
# "signature", which is just a name.
@ -210,6 +211,8 @@ class QAPIDescription(ParserFix):
def add_target_and_index(
self, name: Signature, sig: str, signode: desc_signature
) -> None:
# pylint: disable=unused-argument
# name is the return value of handle_signature.
# sig is the original, raw text argument to handle_signature.
# For QAPI, these are identical, currently.