Skip to content

Support for disabling specific rules from auto-fixing on save #260

@foucdeg

Description

@foucdeg

When coding, it is annoying that our temporary imports and variables that we haven't yet used are removed every time we save the file.

We'd like the Ruff extension to auto-fix on save in general (and we have that activated using editor.codeActionsOnSave), but not F401 (unused imports) and F841 (unused variables).

We do want the rule to autofix in other contexts (pre-commit hook, CI). Is there a way to do that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    code-actionsRelated to code actionsconfigurationRelated to settings and configurationenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions