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: continuation line missing indentation or outdented #408

Open
graingert opened this issue Jun 22, 2015 · 2 comments
Open

Comments

@graingert
Copy link
Member

It seems there's a false positive for E122.

Consider the following snippet

# pep8test.py
def foo(bar):
    pass

# valid:
{
    'title': (
        'Brixton Summer Solstice Roof Party 2015 With DJ Kon'
        ' (3 Hr Sunset Set)'
    ),
}

# valid:
{
    'time_london':
        foo('hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhello'),
}

# valid:
{
    'time_london':
        'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhello',
    'title': (
        'Brixton Summer Solstice Roof Party 2015 With DJ Kon'
        ' (3 Hr Sunset Set)'
    ),
}


# invalid:
{
    'time_london':
        foo('hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhello'),
    'title': (
        'Brixton Summer Solstice Roof Party 2015 With DJ Kon'
        ' (3 Hr Sunset Set)'
    ),
}

When running pep8 I get:

pep8test.py:37:5: E122 continuation line missing indentation or outdented
@sigmavirus24
Copy link
Member

Yeah, I can confirm this. That's very bizarre.

@dekkers
Copy link

dekkers commented Jul 29, 2015

Argh, I just saw flake8 depends on 1.5.7 and not the latest version. Tried again with 1.6.2 and the problem is gone.

It looks like I just hit the same bug with a piece of code like this:

def a(x, y, z):
    pass


def b():
    pass

c = None

a(c,
  {
      'a': 'a',
  }, c)

a(b(),
  {
      'a': 'a',
  }, c)

Running pep8 on it gives:

test.py:18:3: E121 continuation line under-indented for hanging indent

@asottile asottile changed the title false positive: E122 continuation line missing indentation or outdented E122: false positive: continuation line missing indentation or outdented Jun 14, 2020
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

3 participants