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

Avoids unnecessary overhead for TC004, when TC001-003 are disabled #14657

Merged

Conversation

Daverball
Copy link
Contributor

@Daverball Daverball commented Nov 28, 2024

Summary

Another minor thing that came up as part of #12927

TC004 doesn't use the runtime_imports vector we're building during analysis of deferred scopes, so we don't need to do that work when it's the only typing import rule that is enabled.

Test Plan

cargo nextest run

Copy link
Contributor

github-actions bot commented Nov 28, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

We still shouldn't run TC004 in stub files, it won't ever cause
violations so we do a whole bunch of work for nothing
Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@MichaReiser MichaReiser added the internal An internal refactor or improvement label Nov 28, 2024
@MichaReiser MichaReiser merged commit d9cbf2f into astral-sh:main Nov 28, 2024
21 checks passed
@Daverball Daverball deleted the refactor/unnecessary-tc004-overhead branch November 28, 2024 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal An internal refactor or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants