ruff/crates/ruff
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
..
resources/test Detect consecutive, non-newline-delimited NumPy sections (#5467) 2023-07-02 20:29:45 -04:00
src Detect consecutive, non-newline-delimited NumPy sections (#5467) 2023-07-02 20:29:45 -04:00
Cargo.toml Experimental release for Jupyter notebook integration (#5363) 2023-06-26 21:22:42 +05:30