Skip to content
This repository was archived by the owner on Mar 7, 2021. It is now read-only.
This repository was archived by the owner on Mar 7, 2021. It is now read-only.

Make F841 ignore setting to __ variable and setting to variables prefixed with _ #34

@Jackenmen

Description

@Jackenmen

While _ is commonly used to name a "throw-away variable", it doesn't work for codebases that use gettext and assign it to a variable called _. In such cases, "throw-away variables" can be named __ instead (I think it's common to gettext-based projects, but I don't have much to prove that). Another thing that I've noticed being used among different projects is to have a "throw-away variable" be prefixed with _, e.g. _some_unused_variable. So, I was wondering if it would be possible to support either of these use cases. I know pylint does support these, amongst a few other patterns and it definitely seems useful to have at least some other way to mark a variable as "throw-away", especially that it is common for i18n projects to use _ for gettext instance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions