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

code inside fstring not getting formatted #3213

Closed
jerryc05 opened this issue Aug 8, 2022 · 1 comment
Closed

code inside fstring not getting formatted #3213

jerryc05 opened this issue Aug 8, 2022 · 1 comment
Labels
C: parser How we parse code. Or fail to parse it. F: strings Related to our handling of strings R: duplicate This issue or pull request already exists T: bug Something isn't working

Comments

@jerryc05
Copy link

jerryc05 commented Aug 8, 2022

Describe the bug

code inside fstring not getting formatted
To Reproduce

For example, take this code:

def fff():
    return 0
    
    
print(   f"asdasd {   fff  ()   } dasdasd"     )

And run it with https://black.vercel.app/?version=main:

The result is:

def fff():
    return 0


print(f"asdasd {   fff  ()   } dasdasd")

Expected behavior

def fff():
    return 0


print(f"asdasd {fff()} dasdasd")

Environment

  • Black's version:
  • OS and Python version:

Additional context

@jerryc05 jerryc05 added the T: bug Something isn't working label Aug 8, 2022
@ichard26 ichard26 added R: duplicate This issue or pull request already exists F: strings Related to our handling of strings C: parser How we parse code. Or fail to parse it. labels Aug 8, 2022
@ichard26
Copy link
Collaborator

ichard26 commented Aug 8, 2022

Hey @jerryc05 thanks for filing a bug report. This is actually a long-standing shortcoming of Black that we've yet resolved. To keep things more organised, I'll be closing this issue as a duplicate of #567.

@ichard26 ichard26 closed this as not planned Won't fix, can't repro, duplicate, stale Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: parser How we parse code. Or fail to parse it. F: strings Related to our handling of strings R: duplicate This issue or pull request already exists T: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants