Skip to content

Support suggesting different fixes for one violation #2713

@not-my-profile

Description

@not-my-profile

Some violations can be fixed in different ways. The Language Server Protocol supports multiple code actions for one location, so it would be nice if ruff could also suggest multiple autofixes for one violation.

Examples:

  • try: ...; except ...: pass -> flake8-simplify suggests using contextlib.suppress instead, whereas flake8-bandit suggests logging the exception

Can you think of other examples?

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixesRelated to suggested fixes for violations

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions