Skip to content

Make throwaway variable (_) pattern configurable #134

@Jackenmen

Description

@Jackenmen

There are cases where _ cannot be used to mark a throwaway variable and it would be great if ruff allowed configuring it. This is common in projects that use gettext for example, as _ is used for translating strings there. One of the ways unused variables are marked in such projects is using __ (double underscore) but it probably would be a good idea to just make it configurable with a sane default to appeal to more uses.

Notably, pylint allows configuring the dummy variable pattern with a regex:
https://pylint.pycqa.org/en/latest/user_guide/configuration/all-options.html#dummy-variables-rgx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions