ruff/crates/ruff_linter
Robsdedude 511710e1ef
[`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>
2025-10-20 18:24:55 -04:00
..
resources [`flake8-gettext`] Resolve qualified names and built-in bindings (`INT001`, `INT002`, `INT003`) (#19045) 2025-10-20 18:24:55 -04:00
src [`flake8-gettext`] Resolve qualified names and built-in bindings (`INT001`, `INT002`, `INT003`) (#19045) 2025-10-20 18:24:55 -04:00
Cargo.toml Bump 0.14.1 (#20925) 2025-10-16 12:44:13 -05:00