Open rominf opened 1 month ago
This is known -- we use a heuristic to detect if a call is a "logging call", and we don't trace name symbols like that. I can't find an obvious issue to link this to though, so I'll leave it as-is.
(logger.warn("...")
should work, but I think you picked that up already :))
Before creating this issue I searched for:
but could not find previous issue or PR.
Minimal code snippet (
ruff_G010_no_call.py
) that reproduces the bug:I invoked
ruff
with:but got no errors.
I expected to get
G010
(https://docs.astral.sh/ruff/rules/logging-warn/) on linewarn = logger.warn
. The code like this is quite wide-spread, here are the results of GitHub search that show code most likely to be invalid in Python 3.13, but that won't be detected with the current version of ruff: https://github.com/search?q=%2F%28%3F-i%29%28logger%7Clogging%29.warn%24%2F+language%3APython&type=codeI installed
ruff
from PyPI first, then fromhttps://github.com/astral-sh/ruff/archive/refs/heads/main.zip
:As a side note, current stable version of
mypy
does not find this issue either.mypy
installed frommaster
can find this issue though.