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

Avoid invalid syntax for format-spec with quotes for all Python versions #14625

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

dhruvmanila
Copy link
Member

Summary

fixes: #14608

The logic that was only applied for 3.12+ target version needs to be applied for other versions as well.

Test Plan

I've moved the existing test cases for 3.12 only to f_string.py so that it's tested against the default target version.

I think we should probably enabled testing for two target version (pre 3.12 and 3.12) but it won't highlight any issue because the parser doesn't consider this. Maybe we should enable this once we have target version specific syntax errors in place (#6591).

@dhruvmanila dhruvmanila added bug Something isn't working formatter Related to the formatter preview Related to preview mode features labels Nov 27, 2024
Copy link
Contributor

ruff-ecosystem results

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@MichaReiser
Copy link
Member

Thank you

@dhruvmanila dhruvmanila merged commit c84c690 into main Nov 27, 2024
21 checks passed
@dhruvmanila dhruvmanila deleted the dhruv/f-string-format-spec-pre-312 branch November 27, 2024 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working formatter Related to the formatter preview Related to preview mode features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

F-string formatting: Invalid syntax for format-spec with double quotes when targeting pre Python 3.12
2 participants