Skip to content

Sentence-length comment and docstring readers miss four layouts #2838

Closed

Description

@ptr727

Follow-up to the change extending sentence-length to comments and docstrings. Four layouts are read wrongly and were left past the local review edit budget.

  • An indented table or command list under a colon line in a non-Python comment is joined into prose, because comment extraction strips the indent before the reader sees it.
  • NumPy-style docstring sections (a name, a dashed underline, name : type lines) are joined into one sentence.
  • A docstring whose closing quotes sit on its last code line takes its indent base from the code, so the code is counted as prose.
  • Google-style Args: bodies are treated as code, so a long sentence under them is not checked.

Each needs a constructed failing input in tests/test_prose_lint.py and a fix in docstring_sentence_findings or comment_sentence_findings.

Activity

  1. ptr727 commented on Oct 11, 2026

    @ptr727
    OwnerAuthor

    Also found: a bullet marker (a dash or asterisk) counts as a word in a comment or docstring, and a numbered marker counts in a docstring and in Markdown, so an item of exactly the cap reports one word over. The Markdown reader does the same today. A fix should strip list markers in one shared place.

  2. ptr727 commented on Oct 11, 2026

    @ptr727
    OwnerAuthor

    Also found: adjacent-docstring splitting infers a boundary from quote characters, so a module docstring with a column-zero line opening with a quote right after a line ending in one splits into two fragments and a long sentence there passes. A fix should take boundaries from the AST string nodes in python_docstring_spans.

  3. added a commit that references this issue on Oct 11, 2026
    fc127f7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions