Skip to content

PYI010: replace func stub's docstrings with '...' even if there already is one. #7021

@Prometheos2

Description

@Prometheos2

Hello,

I've noticed PYI010's autofix replaces function stubs' docstrings with ellipsis regardless of if there is one already or not.

Minimal code snippet

def function():
    """doc"""
    ...

Details

  • The commands I invoked:

    • the VSC extension's autofix
    • ruff . --fix
    • ruff . --fix --isolated --select "PYI" (got a error: Failed to converge after 100 iterations. with this one; will create a new issue soon)
  • The current Ruff version: 0.0.286

The current Ruff settings

  • A ruff.toml file on the project root (linted file is in a typings subfolder)
select = [
	# ...
	"PYI",  # flake8-pyi
	# ...
]
include = ["*.py", "*.pyi", "*.ipynb", "pyproject.toml", "rust.toml"]
ignore = ["E501", "N999"]
target-version = "py38"
src = ["Phonebook_analyzer"]
  • Added a # "PYI010" in unfixable after the first command; no sure if it's relevant.

Thanks for the linter, btw; it's really awesome!

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions