Skip to content

Missing GL06 and GL07 errors for invalid docstrings #26307

Closed
@Scowley4

Description

@Scowley4

As discovered in the process of working on #26301, there are invalid docstrings that should throw either GL06 - Found unknown section or GL07 - Sections are in the wrong order errors.

Without too much investigation, it's not clear why GL06 is not being thrown. Currently unsure if this is even a problem because, as @datapythonista mentioned in comments on #26301, we may not even run these checks on the private methods.

The missing GL07 are because section headers were only considered section headers if the following line had an equal number of -----'s (underlines).

This code is found here (where content[0] is the section header):

if (len(content) > 1
and len(content[0]) == len(content[1])
and set(content[1]) == {'-'}):
sections.append(content[0])

  • Reorder sections that are failing DOC Fix inconsistencies #26301 and merge
  • Fix GL07 to correctly throw errors with invalid underlines
  • Investigate GL06
  • Add error for valid section title words with invalid number of underlines

If it's okay with others, I'd like to take a crack at this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Code StyleCode style, linting, code_checksDocs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions