You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
@marksweb tagging you in just in case you know of existing solutions. This is something I didn't think of when doing the code review, I'll try to pay more attention next time.
For now I've used git grep -E '\b_[^(_a-zA-Z9-9]' -- '*.py' to check for usage of the throwaway _ variable and I'm confident that we don't have other instances of this error currently.
I've looked around a bit and haven't found any available plugins, so this might need to be custom-made 🤔
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 forgettext
. I'm hoping there's already aflake8
plugin for it, or something similar.The text was updated successfully, but these errors were encountered: