E301: reported incorrectly after ignored E303
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5.2k
- Forks
- 754
- PR merge metrics
- No merged PRs in 30d
Description
Hello, 👋
I have a following code in foo.py:
1 class FooBar:
2
3 def foo(self):
4 pass
5
6
7 # Comment
8
9 def bar(self):
10 pass
and running pycodestyle --ignore=E303 foo.py (E303 - Too many blank lines) reports foo.py:9:5: E301 expected 1 blank line, found 0 even there is a blank line.
There is one more thing that is confusing me - I'm able to fix this error by adding new line between def bar and pass.
Any idea what could be wrong here?
Thanks
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
Reproduce the report with the shown foo.py example and the pycodestyle --ignore=E303 foo.py command. Trace how ignored E303 findings affect the E301 blank-line calculation; done when the existing blank line no longer produces a false E301 while E303 remains ignored.
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
- 38/100