8000 check-docstring-first false positive on attribute docstrings · Issue #159 · pre-commit/pre-commit-hooks · GitHub
[go: up one dir, main page]

Skip to content
check-docstring-first false positive on attribute docstrings #159
@jaraco

Description

@jaraco

Attribute docstrings, as defined in PEP-257 are strings immediately following top level module names. For example:

name = "my variable"
"""the name used by the module for x, y, and z"""

The check-docstring-first incorrectly identifies this attribute docstring as a module docstring, indicating either Multiple module docstrings (first docstring on line N). or Module docstring appears after code (code seen on line N)..

In light of this issue, I'm not sure the check-docstring-first check has much value at all. At the very least, the check should not be failing when a docstring follows an assignment.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0