Skip to content

[ty] Add quick fix to remove redundant cast#25211

Merged
MichaReiser merged 5 commits into
astral-sh:mainfrom
sqqueak:quick-fix-redundant-cast
May 20, 2026
Merged

[ty] Add quick fix to remove redundant cast#25211
MichaReiser merged 5 commits into
astral-sh:mainfrom
sqqueak:quick-fix-redundant-cast

Conversation

@sqqueak
Copy link
Copy Markdown
Contributor

@sqqueak sqqueak commented May 17, 2026

Summary

Closes astral-sh/ty#3451

This PR adds the option to remove a redundant cast via quick fix. It is implemented using safe_edit as mentioned in the issue.

Test Plan

Updated and passed tests

@astral-sh-bot astral-sh-bot Bot added the ty Multi-file analysis & type inference label May 17, 2026
@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot Bot commented May 17, 2026

Typing conformance results

No changes detected ✅

Current numbers
The percentage of diagnostics emitted that were expected errors held steady at 89.36%. The percentage of expected errors that received a diagnostic held steady at 85.49%. The number of fully passing files held steady at 88/134.

@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot Bot commented May 17, 2026

Memory usage report

Memory usage unchanged ✅

@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot Bot commented May 17, 2026

ecosystem-analyzer results

No diagnostic changes detected ✅

Full report with detailed diff (timing results)

Comment thread crates/ty_python_semantic/src/types/function.rs Outdated
Comment thread crates/ty_python_semantic/resources/mdtest/directives/cast.md
Copy link
Copy Markdown
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.

Thank you

@MichaReiser MichaReiser enabled auto-merge (squash) May 20, 2026 10:15
@MichaReiser MichaReiser merged commit 590ad07 into astral-sh:main May 20, 2026
58 of 59 checks passed
thejchap pushed a commit to thejchap/ruff that referenced this pull request May 23, 2026
Co-authored-by: Micha Reiser <micha@reiser.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

redundant-cast quick fix

3 participants