Fix E392.

This commit is contained in:
Dave Halter
2017-07-06 01:46:52 +02:00
parent 0a76c45153
commit 280f3edf6d
2 changed files with 16 additions and 1 deletions

View File

@@ -642,6 +642,9 @@ class PEP8Normalizer(Normalizer):
indentation = re.match('[ \t]*', line).group(0)
start_pos = leaf.line + i, len(indentation)
# TODO check multiline indentation.
elif typ == 'endmarker':
if self._newline_count >= 2:
self.add_issue(391, 'Blank line at end of file', leaf)
return leaf.value
@@ -676,7 +679,7 @@ class FooRule(Rule):
@PEP8NormalizerConfig.register_rule
class BlankLineAtEnd(Rule):
code = 'W391'
code = 391
message = 'blank line at end of file'
leaf_event = ['endmarker']