Micha Reiser
Micha Reiser
We discussed this internally and we agreed on: * Using the `for` introduced variable outside of a loop is likely a bug. There are cases where this is intentional, but...
Some interesting cases from the ecosystem check **Variable declared outside the loop** I think the code here is correct because the variable is first defined outside the loop as being...
It makes sense to me that Ruff shouldn't provide an autofix in this case because it breaks user code. Doing this would require that Ruff understands doctests and takes them...
I agree. We should not offer fixes if we know they're incorrect. We could consider offering fixes for raw-strings if they don't contain any quotes or backslashes.
No worries and thanks for the heads up. There are no expectations at all. I only requested changes to make it clear that this PR isn't waiting on me.
> > At least I don't see any quote selection that results in valid pre python312 code. > > This would work: `f"""{'''test ' '''}{'''other " '''}"""`. Probably better for...
Thanks for the kind words. Hmm interesting. I've never seen a security warning when running ruff as part of pre-commit. Can you tell me more on how you run ruff?
> when I explicitly run the copy of ruff that pre-commit has cached: ~/.cache/pre-commit/repoxlgredg0/py_env-python3.13/bin/ruff. Do I understand this correctly that you manually run `~/.cache/pre-commit/repoxlgredg0/py_env-python3.13/bin/ruff`? You don't run ruff using `pre-commit`?
@ulgens Can you share a full code example because I'm unable to reproduce the issue in the playground; https://play.ruff.rs/bdf4614f-9c68-4943-947f-05a1cf2a16f2
Thanks. Yes, that helps to understand the issue. Ruff doesn't perform any alias analysis for this rule (analysing if a variable `x` points to `BaseModel`). That's why it isn't picked...