PyCQA / PyCQA/pycodestyle

E122: false positive: continuation line missing indentation or outdented

Open
#408 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
5.2k
Forks
754
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the E122 report from the examples in pep8test.py, then trace the E122 checker in the repository's Python implementation. Done means the three valid snippets produce no E122 warning while the marked invalid snippet still reports the expected indentation error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.