Closed
Description
This might be incredibly easy to fix depending on how this check is implemented. Currently RUF027 can be triggered by something like:
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from datetime import date
path = "foo/{date}/" # RUF027
Now, to be fair, this would also be a false positive for a runtime binding. But this seems like an easy low hanging fruit to reduce the false positive rate at least a little bit.
Although a more reliable solution long-term would be to add a setting for specifying additional methods which expect a template string.