[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 05/47] qapi/doc.py: Change code templates from function to
From: |
Cleber Rosa |
Subject: |
Re: [PATCH v3 05/47] qapi/doc.py: Change code templates from function to string |
Date: |
Mon, 28 Sep 2020 23:51:13 -0400 |
On Thu, Sep 24, 2020 at 08:28:18PM -0400, John Snow wrote:
> For whatever reason, when these are stored as functions instead of
> strings, it confuses sphinx-autodoc into believing them to be
> docstrings, and it chokes on the syntax.
>
Interesting...
> Keeping them as dumb strings instead avoids the problem.
>
I actually think it's a more honest approach, and easier to read.
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
> scripts/qapi/doc.py | 40 ++++++++++++++++++++--------------------
> 1 file changed, 20 insertions(+), 20 deletions(-)
>
> diff --git a/scripts/qapi/doc.py b/scripts/qapi/doc.py
> index c41e9d29f5..d12eda9e1e 100644
> --- a/scripts/qapi/doc.py
> +++ b/scripts/qapi/doc.py
> @@ -8,26 +8,26 @@
> from qapi.gen import QAPIGenDoc, QAPISchemaVisitor
>
>
> -MSG_FMT = """
> +_MSG = '''
> @deftypefn {type} {{}} {name}
>
> {body}{members}{features}{sections}
> @end deftypefn
>
> -""".format
> +'''
>
I know it doesn't make syntactic difference, but is there a reson for
also changing the quote style?
- Cleber.
signature.asc
Description: PGP signature
- Re: [PATCH v3 12/47] qapi: enforce import order/styling with isort, (continued)
Re: [PATCH v3 12/47] qapi: enforce import order/styling with isort, Cleber Rosa, 2020/09/29
[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, 2020/09/24
[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