Brent Westbrook

Results 101 comments of Brent Westbrook

Yeah, that's why I didn't immediately consider these to be bugs. I found at least one case in #21891 where the `extend` version is actually faster. Assuming we don't want...

This makes some sense to me. It's similar to [runtime-import-in-type-checking-block (TC004)](https://docs.astral.sh/ruff/rules/runtime-import-in-type-checking-block/#runtime-import-in-type-checking-block-tc004) but extending to members of the same module.

I'll leave the main review to @amyreese, but this looks reasonable overall to me. Would you mind re-numbering the rule to RUF068? We have existing PRs for [RUF066](https://github.com/astral-sh/ruff/pull/9911) and [RUF067](https://github.com/astral-sh/ruff/pull/20585).

Apologies for the delay here. I just wanted to say thanks for your work on this, and that I do intend to take a closer look at some point!

If I understand correctly, we could get by without type inference if we're just looking for `monkeypatch.setattr` with a string as the second argument and recommending to use `__name__` instead....

Hmm, yeah this makes sense to me! I looked through the history a bit and didn't see any reason why these were restricted to `error` and `critical` (`critical` itself is...

Go for it! I don't see any open PRs for this issue or this rule.

I think it would be okay to try that change too and take a look at the ecosystem impact. I took a brief look through the git history and didn't...

I always have to study our [fix safety docs](https://docs.astral.sh/ruff/linter/#fix-safety) again to be sure, but based on the main two criteria (safe fixes don't change runtime behavior or remove comments), I...

Could you take a look at the ecosystem check too? I don't think we should be changing when the rule applies, only the safety of its fix, but it looks...