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

E122 false positive after new line string concatenation with f-string #1263

Closed
dsotirho-ucsc opened this issue Sep 28, 2024 · 1 comment
Closed

Comments

@dsotirho-ucsc
Copy link

The following code…

dict(a='AAA'
       f'{4*2}',
     b=[
         'BBB',
         'BBB',
     ],
     c='CCC')

…causes

example.py:6:6: E122 continuation line missing indentation or outdented

The required conditions for this false positive appear to be:

  • an argument who's value is a string concatenation that includes an f-string
  • a following argument who's value is a multi-line list statement

The false positive does not occur if:

  • a is only an f-string
  • a is a new line concatenated string without an f-string
  • b is a single line list literal
  • b occurs before a

Verified with flake8 7.1.1

@asottile
Copy link
Member

fairly certain this is a duplicate of #408 and/or #372 -- that said that code is pretty ugly so not surprised there's a diagnostic from it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants