Skip to content

Incorrect handling of cvar, ivar and vartype tags in sphynx-style #271

@pedropaulofb

Description

@pedropaulofb

I would like to use cvar, ivar and vartype of the sphyx docstring syntax, however, docformatter is incorrectly handling them.

Expected:

    """Abstract base class representing a generic element within an OntoUML model.

    :ivar id: A unique identifier for the element, automatically generated upon instantiation.
    :vartype id: str
    :ivar created: Timestamp when the element was created, defaults to the current time.
    :vartype created: datetime
    :ivar modified: Timestamp when the element was last modified, can be None if not modified.
    :vartype modified: Optional[datetime]
    :ivar in_project: List of projects this element is part of. Direct modification is restricted.
    :vartype in_project: list[Project]
    """

Result:

    """Abstract base class representing a generic element within an OntoUML model.

    :ivar id: A unique identifier for the element, automatically generated upon instantiation. :vartype id: str :ivar
    created: Timestamp when the element was created, defaults to the current time. :vartype created: datetime :ivar
    modified: Timestamp when the element was last modified, can be None if not modified. :vartype modified:
    Optional[datetime] :ivar in_project: List of projects this element is part of. Direct modification is restricted.
    :vartype in_project: list[Project]
    """

Is there a workaround to solve this issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: styleRelates to docstring format style (e.g., Google, NumPy, Sphinx)P: bugPEP 257 violation or existing functionality that doesn't work as documentedU: mediumA relatively medium urgency issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions