-
Notifications
You must be signed in to change notification settings - Fork 2k
D406 removes colons where D416 adds them #13139
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't workingdocstringRelated to docstring linting or formattingRelated to docstring linting or formatting
Description
- List of keywords you searched for before creating this issue. Write them down here so that others can find this issue more easily and help provide feedback.
"section-name-ends-in-colon", "D416", "removed", "autofix"
- A minimal code snippet that reproduces the bug.
Ruff seems to auto-fix
def foo(a: str) -> str:
"""Foo bar.
Args:
a: Some argument.
Examples
Some explanation here.
>>> bla bla bla
"""
return ato
def foo(a: str) -> str:
"""Foo bar.
Args:
a: Some argument.
Examples:
Some explanation here.
>>> bla bla bla
"""
return a, but it changes (in my eyes erroneously?):
def foo(a: str) -> str:
"""Foo bar.
Examples:
Some explanation here.
>>> bla bla bla
"""
return ato
def foo(a: str) -> str:
"""Foo bar.
Examples
Some explanation here.
>>> bla bla bla
"""
return aShould this be the case?
-
The command you invoked (e.g.,
ruff /path/to/file.py --fix), ideally including the--isolatedflag.
Any ruff command with autofix -
The current Ruff settings (any relevant sections from your
pyproject.toml).
[tool.ruff]
line-length = 120
target-version = "py38"
[tool.ruff.lint]
# see: https://beta.ruff.rs/docs/rules/
ignore = [
"D104", # undocumented-public-package
"D401", # first-line should be in imperative mood
# D407 needs to be ignored as it otherwise messes up the formatting in our API docs
"D407" # missing dashed underline after section
]
ignore-init-module-imports = true # TODO: remove as deprecated soon
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"D", # pydocstyle
"T201", # print
"C4", # flake8-comprehensions
"RUF", # Ruff-specific rules
"PL" # pylint
]- The current Ruff version (
ruff --version).
0.6.2
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingdocstringRelated to docstring linting or formattingRelated to docstring linting or formatting