astral-sh / ruff

An extremely fast Python linter and code formatter, written in Rust.
https://docs.astral.sh/ruff
MIT License
33k stars 1.1k forks source link

More rules out of stub author's control #14535

Open Samuel-Therrien-Beslogic opened 5 hours ago

Samuel-Therrien-Beslogic commented 5 hours ago

Ruff 0.8.0 ignores ambiguous-variable-name (E741) automatically in pyi files. This prompted me to look at other rules I disable specifically for .pyi files and found the following which I think should apply in all cases:

I haven't gone back and validated if these still trigger in stub files since I added them to our shared config, sorry if I tagged a rule that's already ignored.

AlexWaygood commented 4 hours ago

Thanks! Your analysis all seems correct to me. I'd happily accept PRs disapplying these rules to stub files.

For E741 we were quite cautious, and made the change preview-only for several minor releases before stabilising the change. I don't think we need to be as cautious this time around. Our versioning policy states that it's fine to apply changes in patch releases if they reduce scope (and these would be reductions in scope); we only need to wait for a minor release if a change increases the scope of a rule.

dylwil3 commented 1 hour ago

The linked PR is for all but the last two bullets since those were suggested with less oomph 😄