mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-03 07:04:53 +00:00
![]() ## Summary Given a docstring like: ```py def f(a: int, b: int) -> int: """Showcase function. Parameters ---------- a : int _description_ b : int _description_ Returns ------- int _description """ ``` We were failing to identify `Returns` as a section, because the previous line was neither empty nor ended with punctuation. This was causing a false negative, where by we weren't flagging a missing line before `Returns`. So, the very reason for the rule (no blank line) was causing us to fail to catch it. Note that, we did have a test case for this, which was working properly: ```py def f() -> int: """Showcase function. Parameters ---------- Returns ------- """ ``` ...because the line before `Returns` "ends in a punctuation mark" (`-`). Closes #5442. |
||
---|---|---|
.. | ||
resources/test | ||
src | ||
Cargo.toml |