Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Daverball opened this issue Jan 18, 2024 · 4 comments
Closed

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

Daverball opened this issue Jan 18, 2024 · 4 comments
Labels
breaking Breaking API change
Milestone

Comments

@Daverball
Copy link
Contributor

Daverball commented Jan 18, 2024

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 charliermarsh added the breaking Breaking API change label Jan 18, 2024
@charliermarsh
Copy link
Member

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

charliermarsh added a commit that referenced this issue Jan 31, 2024
## Summary

This rule was added to `flake8-type-checking` as `TC010`. We're about to
stabilize it, so we might as well use the correct code.

See: #9573.
zanieb pushed a commit that referenced this issue Feb 1, 2024
## Summary

This rule was added to `flake8-type-checking` as `TC010`. We're about to
stabilize it, so we might as well use the correct code.

See: #9573.
zanieb pushed a commit that referenced this issue Feb 1, 2024
## Summary

This rule was added to `flake8-type-checking` as `TC010`. We're about to
stabilize it, so we might as well use the correct code.

See: #9573.
@Daverball
Copy link
Contributor Author

@AlexWaygood Could we fit this into the 0.8.0 release (i.e. renaming TCH to TC while leaving redirects)?

Otherwise I will need to wait until the TCH006 -> TCH010 redirect gets removed before I can implement TC006.

I'm happy to open a PR myself.

@AlexWaygood
Copy link
Member

@Daverball unfortunately I'm already somewhat behind on my tasks for this release, so I won't be able to work on this myself. I'd be very happy to review a PR targeting the ruff-0.8 branch, however.

I can't immediately find the PRs in the past where we've remapped rules, but there have been some -- if you can find them, they should be a good template to use

@MichaReiser
Copy link
Member

This change will be released as part of Ruff 0.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Breaking API change
Projects
None yet
Development

No branches or pull requests

4 participants