Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive when documenting dataclass attributes for Sphinx #138

Open
darosio opened this issue Jun 25, 2024 · 2 comments
Open

False positive when documenting dataclass attributes for Sphinx #138

darosio opened this issue Jun 25, 2024 · 2 comments

Comments

@darosio
Copy link

darosio commented Jun 25, 2024

Hi 👋

dataclass definiiton like

@dataclass
class ObjsParams:
    """Parameters for something."""

    #: Maximum number of objects to generate
    max_num_objects: int = 8
    #: Number of rows in the image frame
    nrows: int = 128

raises DOC601 and DOC603 errors. But it is a common practice to document dataclasses using Sphinx.

@jsh9
Copy link
Owner

jsh9 commented Jun 25, 2024

Hi @darosio ,

I've found that the correct Sphinx docstring format for class attributes is like this: https://jsh9.github.io/pydoclint/checking_class_attributes.html#3-sphinx-style

Does it align with your understanding of the Sphinx style?

@darosio
Copy link
Author

darosio commented Jun 25, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants