Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Cop to disallow use of _() in constants. #58

Open
Fryguy opened this issue Nov 9, 2022 · 0 comments
Open

New Cop to disallow use of _() in constants. #58

Fryguy opened this issue Nov 9, 2022 · 0 comments

Comments

@Fryguy
Copy link

Fryguy commented Nov 9, 2022

Is your feature request related to a problem? Please describe.

It's not uncommon for new users of gettext to use _() in constants, not realize that will translate at first load and not on demand. This is easy to miss in code review.

Describe the solution you'd like

I'd like to see a Cop that checks for usage of _() in constants. Secondarily, if it's possible, it would useful to also detect memoized usage of _() in a class methods or global context.

Describe alternatives you've considered
Additional context

None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant