[refurb] Fix false positive for float and complex numbers in FURB116#17661
Merged
MichaReiser merged 1 commit intoastral-sh:mainfrom May 3, 2025
Merged
[refurb] Fix false positive for float and complex numbers in FURB116#17661MichaReiser merged 1 commit intoastral-sh:mainfrom
refurb] Fix false positive for float and complex numbers in FURB116#17661MichaReiser merged 1 commit intoastral-sh:mainfrom
Conversation
Contributor
|
ntBre
pushed a commit
that referenced
this pull request
May 12, 2025
…#17692) <!-- Thank you for contributing to Ruff! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? - Does this pull request include references to any relevant issues? --> ## Summary We can only guarantee the safety of the autofix for number literals, all other cases may change the runtime behaviour of the program or introduce a syntax error. For the cases reported in the issue that would result in a syntax error, I disabled the autofix. Follow-up of #17661. Fixes #16472. <!-- What's the purpose of the change? What does it do, and why? --> ## Test Plan Snapshot tests. <!-- How was it tested? -->
Glyphack
pushed a commit
to Glyphack/ruff
that referenced
this pull request
May 21, 2025
…astral-sh#17692) <!-- Thank you for contributing to Ruff! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? - Does this pull request include references to any relevant issues? --> ## Summary We can only guarantee the safety of the autofix for number literals, all other cases may change the runtime behaviour of the program or introduce a syntax error. For the cases reported in the issue that would result in a syntax error, I disabled the autofix. Follow-up of astral-sh#17661. Fixes astral-sh#16472. <!-- What's the purpose of the change? What does it do, and why? --> ## Test Plan Snapshot tests. <!-- How was it tested? -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Partially fixes #16472. Addresses the false positive for float and complex numbers.
I'm going to fix the other issues in another PR.
Test Plan
Snapshot tests.