Skip to content

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

Merged
dhruvmanila merged 1 commit intomainfrom
dhruv/f-string-format-spec-pre-312
Nov 27, 2024
Merged

Avoid invalid syntax for format-spec with quotes for all Python versions#14625
dhruvmanila merged 1 commit intomainfrom
dhruv/f-string-format-spec-pre-312

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
@github-actions
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

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