-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
bugSomething isn't workingSomething isn't workingdocstringRelated to docstring linting or formattingRelated to docstring linting or formattinghelp wantedContributions especially welcomeContributions especially welcomeruleImplementing or modifying a lint ruleImplementing or modifying a lint rule
Description
When ruff fixes both D208 (over-indentation) and D209 (new-line-after-last-paragraph) on the same line, it results in unexpected changes.
I share the minimum test case.
Target code:
def test_func(a: int) -> None:
"""Minimum test case.
Parameters
----------
a : int
A parameter."""
passSettings in pyproject.toml:
[tool.ruff]
show-fixes = true
[tool.ruff.lint]
select = ["D"]
[tool.ruff.lint.pydocstyle]
convention = "numpy"Run above command:
ruff check target.py --fixExpected results:
def test_func(a: int) -> None:
"""Minimum test case.
Parameters
----------
a : int
A parameter.
"""
passbut, actual:
def test_func(a: int) -> None:
"""Minimum test case.
Parameters
----------
a : int
A parameter.
"""
passReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingdocstringRelated to docstring linting or formattingRelated to docstring linting or formattinghelp wantedContributions especially welcomeContributions especially welcomeruleImplementing or modifying a lint ruleImplementing or modifying a lint rule