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

Change more usages of SemanticModel::is_builtin to use resolve_builtin_symbol or match_builtin_expr #10982

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

AlexWaygood
Copy link
Member

Summary

This PR switches more callsites of SemanticModel::is_builtin to move over to the new methods I introduced in #10919, which are more concise and more accurate. I missed these calls in the first PR.

Test Plan

cargo test. I haven't introduced any new tests in this PR, because I added quite a few in #10919, and this is just doing the same thing as that PR. One existing violation in the test fixtures becomes newly fixable, though.

@AlexWaygood AlexWaygood added the internal An internal refactor or improvement label Apr 16, 2024
@AlexWaygood
Copy link
Member Author

I've added the internal label because we don't need two changelog entries for #10919 and this.

@AlexWaygood AlexWaygood force-pushed the builtins-3 branch 2 times, most recently from e0ca789 to 3c5bf04 Compare April 16, 2024 21:00
@AlexWaygood
Copy link
Member Author

AlexWaygood commented Apr 16, 2024

Performance is overall neutral, but some linter benchmarks are showing regressions of 1-2%. I think that's probably okay, given that #10982 was also overall neutral, and the final version of that PR had improvements of 2-3% on some of the same benchmarks. I can't see an easy/clean way of moving the calls to the semantic model lower down in any of the rules I'm touching here.

Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@AlexWaygood AlexWaygood merged commit f48a794 into astral-sh:main Apr 17, 2024
17 checks passed
@AlexWaygood AlexWaygood deleted the builtins-3 branch April 17, 2024 06:50
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.

None yet

2 participants