Skip to content

False blank line and unindent warnings  #122

Open
@01-Jacky

Description

@01-Jacky

I have a project using sphinx 2.2.2, sphinx.ext.autodoc, and latest sphinx_autodoc_typehints

Using these two extensions and the below flags in conf.py causes "WARNING: Field list ends without a blank line; unexpected unindent." in the __init__ function of a class.

autoclass_content = "both"
always_document_param_types = True

The docstrings to be appears fine on this demo class

class Foo:
    """Class to demo a bug"""

    def __init__(self, magic_num: int) -> None:
        """Creates the Foo

        :param magic_num: some magic number

        """
        self.magic_num = magic_num

Looks like the html output ends up generating parameters twice, might relate to that?

This seems run fine if I switch to sphinx_autodoc_typehints 1.7.0 but anything above causes this warning.

Here's a demo repo that reproduce the bug. https://github.com/01-Jacky/autodoc-typehints-bug

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions