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

F523: Single variable with single quotes triggers syntax violation #4823

Closed
Tracked by #4972
addisoncrump opened this issue Jun 3, 2023 · 2 comments · Fixed by #4836
Closed
Tracked by #4972

F523: Single variable with single quotes triggers syntax violation #4823

addisoncrump opened this issue Jun 3, 2023 · 2 comments · Fixed by #4836
Assignees
Labels
bug Something isn't working

Comments

@addisoncrump
Copy link
Contributor

Reproduction

The following snippet is a minimal reproduction:

x = 5
'".'.format(x)

The fix attempted:

x = 5
"".".format()

Command line

ruff check format.py --fix --isolated

Version information

Built on e82160a (latest, bleeding).

Misc

Discovered by #4822.

@charliermarsh
Copy link
Member

Thanks!

@charliermarsh
Copy link
Member

Looks like F523 always uses double quotes: new_format_string = format!(r#""{new_format_string}""#);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants