Require two blank lines after toplevel def/class; issue #400#402
Require two blank lines after toplevel def/class; issue #400#402benesch wants to merge 2 commits intoPyCQA:masterfrom
Conversation
There was a problem hiding this comment.
Shouldn't that expect 2 blank lines after the def or class? Sure it's checking for the next logical line if before it there are two lines but only because the block above was a def or class.
Maybe also mention that it expects two lines after a method-level function or class (I know E302 doesn't mention that too but that may be improved too?).
There was a problem hiding this comment.
Hmm? I'm pretty sure the condition is right: it's looking for a non-indented line that's preceded by more or less than two blank lines where the preceding non-blank non-indented line was a function or class definition.
It doesn't actually expect two lines after a method-level function or class, since those are only supposed to have one separating blank line according to PEP 8.
There was a problem hiding this comment.
The condition is right but I find the message confusing.
There was a problem hiding this comment.
Ah, agreed! I'll defer that to another diff, though.
|
This hasn't been worked on since August 2015 last year. For PyCon Sprints 2016, I've fixed the conflicts in this new branch and rebase-squashed both commits into 1 commit: #536 |
Here's my attempt to fix issue #400. Not sure what the backwards compatibility policy on this'll be, so I left it as enabled by default.