Skip to content

Lint rule to catch incorrect sphinx directives #18425

Closed
@Scorpil

Description

@Scorpil

Code Sample, a copy-pastable example if possible

None. Documentation / build issue.

Problem description

There are few places where tag "versionadded" misses one semicolon, making it a sphinx comment instead of directive:

pandas/core/frame.py
4516:            .. versionadded: 0.18.0
4679:            .. versionadded: 0.16.1

pandas/core/generic.py
968:            .. versionadded: 0.21.0

pandas/core/series.py
1629:            .. versionadded: 0.19.0
2216:            .. versionadded: 0.18.0

pandas/core/tools/datetimes.py
117:        .. versionadded: 0.18.1
143:        .. versionadded: 0.16.1
181:        .. versionadded: 0.20.0
187:        .. versionadded: 0.22.0

pandas/tseries/offsets.py
778:    .. versionadded: 0.16.1
882:    .. versionadded: 0.18.1

Correct way to use it: .. versionadded:: x.xx.x" (note two semicolons).

Apart from fixing it here and now, it would be useful to have a lint rule that warns contributors about this and similar issues in future (in docstrings and in docs).

Expected Output

Lint rule to catch incorrect sphinx directives.

Output of pd.show_versions()

Doesn't matter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CIContinuous IntegrationDocs

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions