ruff/crates
Charlie Marsh b32d1e8d78
Detect consecutive, non-newline-delimited NumPy sections (#5467)
## 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.
2023-07-02 20:29:45 -04:00
..
flake8_to_ruff Bump version to 0.0.275 (#5276) 2023-06-21 21:53:37 -04:00
ruff Detect consecutive, non-newline-delimited NumPy sections (#5467) 2023-07-02 20:29:45 -04:00
ruff_benchmark Create PyFormatOptions 2023-06-26 14:02:17 +02:00
ruff_cache Only use a single cache file per Python package (#5117) 2023-06-19 17:46:13 +02:00
ruff_cli Make standard input detection robust to invalid arguments (#5393) 2023-06-28 14:52:23 +00:00
ruff_dev Use rayon to parallelize the stability check 2023-06-30 10:05:25 +02:00
ruff_diagnostics Use consistent Cargo.toml metadata in all crates (#5015) 2023-06-12 00:02:40 +00:00
ruff_formatter Show BestFitting mode if it isn't FirstLine (#5452) 2023-06-30 09:49:00 +00:00
ruff_index Run rustfmt on nightly to clean up erroneous comments (#5106) 2023-06-15 00:19:05 +00:00
ruff_macros Avoid including nursery rules in linter-level selectors (#5268) 2023-06-21 20:11:40 +00:00
ruff_python_ast Remove prelude from ruff_python_ast (#5369) 2023-06-26 11:43:49 -04:00
ruff_python_formatter Normalize '\r' in string literals to '\n' 2023-06-30 10:13:23 +02:00
ruff_python_resolver Remove an unsafe access in the resolver (#5428) 2023-06-28 19:08:10 +00:00
ruff_python_semantic Run shadowed-variable analyses in deferred handlers (#5181) 2023-06-29 00:08:18 +00:00
ruff_python_stdlib Rewrite a variety of .contains() calls as matches! statements (#5432) 2023-06-28 22:42:27 -04:00
ruff_python_whitespace Use consistent Cargo.toml metadata in all crates (#5015) 2023-06-12 00:02:40 +00:00
ruff_rustpython Use consistent Cargo.toml metadata in all crates (#5015) 2023-06-12 00:02:40 +00:00
ruff_textwrap Use consistent Cargo.toml metadata in all crates (#5015) 2023-06-12 00:02:40 +00:00
ruff_wasm Fix autofix capabilities in playground (#5375) 2023-06-26 16:40:28 +00:00