astral-sh / ruff

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

Reharmonize `TCH*` rules with flake8-type-checking #9573

Open Daverball opened 7 months ago

Daverball commented 7 months ago

There recently have been a whole bunch of contributions to flake8-type-checking made by yours truly which greatly decreased the rate of false positives/negatives and added new rules, as well as better support for SQLAlchemy.

Ruff independently added one of the rules which is slated to be added to flake8-type-checking in the next release as TC010 (string union syntax), whereas in Ruff the rule is TCH006.

Considering there's no longer a naming conflict in the TC* range (tryceratops kindly changed its code to match ruff's) I would suggest deprecating the TCH* rules and keep aliases around for backwards compatibility. At the same time we can reharmonize the rule numbering and make TCH006 alias to TC010.

I can take a stab at porting some of the improvements from flake8-type-checking to Ruff, although I'm still a Rust novice, so I can't guarantee I will be able to contribute in a meaningful manner any time soon.

charliermarsh commented 7 months ago

I think this makes sense, I don't know if it will be part of 0.2.0 or not. \cc @zanieb