Skip to content

Add tool to catch the shadowing of _ (gettext) #1721

Open
@bmispelon

Description

@bmispelon

With the fantastic work that's been going on to make the site translatable, we've been using the _ alias for gettext more and more throughout the codebase.

Unfortunately, the name _ is also sometimes used to create throwaway variables, and this can lead to crashes (see e995213).

It would be nice if he had a tool to warn us when reusing the name _ for a throwaway variable in a file that already has _ as an alias for gettext. I'm hoping there's already a flake8 plugin for it, or something similar.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions