ruff/crates/ruff_linter/src/docstrings
Mikko Leppänen b4f2882b72
[pydocstyle-D405] Allow using parameters as a sub-section header (#9894)
## Summary

This review contains a fix for
[D405](https://docs.astral.sh/ruff/rules/capitalize-section-name/)
(capitalize-section-name)
The problem is that Ruff considers the sub-section header as a normal
section if it has the same name as some section name. For instance, a
function/method has an argument named "parameters". This only applies if
you use Numpy style docstring.

See: [ISSUE](https://github.com/astral-sh/ruff/issues/9806)

The following will not raise D405 after the fix:
```python  
def some_function(parameters: list[str]):
    """A function with a parameters parameter

    Parameters
    ----------

    parameters:
        A list of string parameters
    """
    ...
```


## Test Plan

```bash
cargo test
```

---------

Co-authored-by: Mikko Leppänen <mikko.leppanen@vaisala.com>
Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2024-02-08 21:54:32 -05:00
..
extraction.rs Split Constant to individual literal nodes (#8064) 2023-10-30 12:13:23 +05:30
google.rs Rename ruff crate to ruff_linter (#7529) 2023-09-20 08:38:27 +02:00
mod.rs Split Constant to individual literal nodes (#8064) 2023-10-30 12:13:23 +05:30
numpy.rs Rename ruff crate to ruff_linter (#7529) 2023-09-20 08:38:27 +02:00
sections.rs [pydocstyle-D405] Allow using parameters as a sub-section header (#9894) 2024-02-08 21:54:32 -05:00
styles.rs Rename ruff crate to ruff_linter (#7529) 2023-09-20 08:38:27 +02:00