-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[flynt] Fix f-string quoting for mixed quote joiners (FLY002)
#20662
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
Conversation
ruff] Fix flynt f-string quoting for mixed quote joiners
| let adjusted_quote = match quote { | ||
| Quote::Single if has_single_quote && !has_double_quote => quote.opposite(), | ||
| Quote::Double if has_double_quote && !has_single_quote => quote.opposite(), | ||
| _ if has_double_quote && has_single_quote => return None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the content includes both single quote and double quote, ruff skips FLY002 for now.
I will improve this logic in a separate pull request as we discussed here.
|
ntBre
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
ruff] Fix flynt f-string quoting for mixed quote joinersflynt] Fix f-string quoting for mixed quote joiners (FLY002)
* origin/main: [`flake8-bugbear`] Include certain guaranteed-mutable expressions: tuples, generators, and assignment expressions (`B006`) (#20024) [`flake8-comprehensions`] Clarify fix safety documentation (`C413`) (#20640) [ty] improve base conda distinction from child conda (#20675) [`ruff`] Extend FA102 with listed PEP 585-compatible APIs (#20659) [`ruff`] Handle argfile expansion errors gracefully (#20691) [`flynt`] Fix f-string quoting for mixed quote joiners (`FLY002`) (#20662) [ty] Fix file root matching for `/` [ruff,ty] Enable tracing's `log` feature [`flake8-annotations`] Fix return type annotations to handle shadowed builtin symbols (`ANN201`, `ANN202`, `ANN204`, `ANN205`, `ANN206`) (#20612) Bump 0.13.3 (#20685) Update benchmarking CI for cargo-codspeed v4 (#20686) [ty] Support single-starred argument for overload call (#20223) [ty] `~T` should never be assignable to `T` (#20606) [`pylint`] Clarify fix safety to include left-hand hashability (`PLR6201`) (#20518) [ty] No union with `Unknown` for module-global symbols (#20664) [`ty`] Reject renaming files to start with slash in Playground (#20666) [ty] Enums: allow multiple aliases to point to the same member (#20669)
Summary
Fixes #19837
Track quote usage across the joiner and parts to choose a safe f-string quote or skip the fix when both appear.
Test Plan
Add regression coverage to FLY002.py