`indent-size` not considered when computing length of tab-indented lines.
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
Research direction
The repository is a single Python file; start by running the supplied tox.ini configuration and test.py reproducer with pycodestyle, then trace line-length calculation for tab-indented lines. Done means E501 reflects indent-size, using four spaces per tab here, including the nested examples.
Written by the indexing model from the issue text.
Description
Hi.
It seems like the indent-size option is not considered for the computation of line-length (looking at the code appears to confirm my suspicion).
This means that there can be a significant number of false negatives for tab-indented lines.
This was tested for pycodestyle 2.10.0 and pycodestyle 2.11.0.
MWE:
All non-ignored test file's lines are longer than the maximum line length, when taking into account the indent-size.
However, only 2 of them are flagged as such.
Each tab counts only 1 space, instead of indent-size spaces.
tox.ini
[pycodestyle]
max-line-length = 5
indent-size = 4
show-source = true
ignore=E261, W191
Test file
if True: # noqa: E501
# aa
# aaa
if True: # noqa: E501
# a
# aa
Pycodestyle's output
pycodestyle test.py
test.py:3:6: E501 line too long (6 > 5 characters)
# aaa
^
test.py:6:6: E501 line too long (6 > 5 characters)
# aa
^
✗ - status code 1
- Dominant language
- Python
- Stars
- 5.2k
- Forks
- 765
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 1
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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.
More from PyCQA/pycodestyle
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
PyCQA/pycodestyle#1294 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
PyCQA/pycodestyle#1302 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
PyCQA/pycodestyle#1242 · 2 comments ·
-
Spurious E231 for nested format substitutionsMay be free again @inchang-ing claimed this 34 days ago, and no pull request is open. Open
Difficulty 3/5 1-2 days Newbie friendliness 68/100
PyCQA/pycodestyle#1241 · 3 comments · 4 reactions ·
-
`exclude` is applied to `.`May be free again @OnlineBunker claimed this 12 days ago, and no pull request is open. Open
Difficulty 3/5 1-2 days Newbie friendliness 45/100
PyCQA/pycodestyle#1217 · 3 comments ·
All issues in PyCQA/pycodestyle
Similar issues
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 85/100
NatLabRockies/openstudio-mcp#286 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
intersystems/ipm#1338 ·
Maintainers usually reply within 1 day
-
separate_packages splits imports from the same explicitly configured packagePossibly taken @rahul05ranjan claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days
-
The v0-through-v1 path derives ShutdownDuration its own way, silently overriding a user's definitionOpenv1
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day