mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 04:45:01 +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. |
||
---|---|---|
.. | ||
flake8_to_ruff | ||
ruff | ||
ruff_benchmark | ||
ruff_cache | ||
ruff_cli | ||
ruff_dev | ||
ruff_diagnostics | ||
ruff_formatter | ||
ruff_index | ||
ruff_macros | ||
ruff_python_ast | ||
ruff_python_formatter | ||
ruff_python_resolver | ||
ruff_python_semantic | ||
ruff_python_stdlib | ||
ruff_python_whitespace | ||
ruff_rustpython | ||
ruff_textwrap | ||
ruff_wasm |