ruff
511710e1 - [`flake8-gettext`] Resolve qualified names and built-in bindings (`INT001`, `INT002`, `INT003`) (#19045)

Commit
51 days ago
[`flake8-gettext`] Resolve qualified names and built-in bindings (`INT001`, `INT002`, `INT003`) (#19045) ## Summary Make rules `INT001`, `INT002`, and `INT003` also * trigger on qualified names when we're sure the calls are calls to the `gettext` module. For example ```python from gettext import gettext as foo foo(f"{'bar'}") # very certain that this is a call to a real `gettext` function => worth linting ``` * trigger on `builtins` bindings ```python from builtins, gettext gettext.install("...") # binds `gettext.gettext` to `builtins._` builtins.__dict__["_"] = ... # also a common pattern _(f"{'bar'}") # should therefore also be linted ``` Fixes: https://github.com/astral-sh/ruff/issues/19028 ## Test Plan Tests have been added to all three rules. --------- Co-authored-by: Brent Westbrook <36778786+ntBre@users.noreply.github.com>
Author
Parents
Loading