E117: False positive with tab indentation
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5.2k
- Forks
- 754
- PR merge metrics
- No merged PRs in 30d
Description
If anything precedes with two spaces, e.g. the indentation of a multiline string flake8 detects an E117 for the next correctly indented line (if indentation uses tabs):
TEST_STRING = '''
foo
bar
'''
if __name__ == '__main__':
print(TEST_STRING) # indented with tab!
test_flake8_e117.py:7:1: E101 indentation contains mixed spaces and tabs
test_flake8_e117.py:7:2: E117 over-indented
$ python3.9 flake8 --version
3.9.2 (mccabe: 0.6.1, pycodestyle: 2.7.0, pyflakes: 2.3.1) CPython 3.9.1 on Linux
I can only reproduce this with flake8, not with raw pycodestyle.
Maybe related #885 #836 #705.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the report from test_flake8_e117.py with Python 3.9, flake8 3.9.2, and the listed pycodestyle version, then compare the result with raw pycodestyle. Trace the E117 indentation handling and add coverage so the correctly indented tab line is not falsely reported, while the genuine mixed-indentation diagnostic remains.
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
- Needs clarification
- Newbie friendliness
- 35/100