Refactor the Rule class a bit.

This commit is contained in:
Dave Halter
2017-08-16 18:17:51 +02:00
parent 51f2de28c6
commit 412da07893
3 changed files with 61 additions and 21 deletions

View File

@@ -712,17 +712,10 @@ class PEP8NormalizerConfig(ErrorFinderConfig):
self.spaces_before_comment = spaces_before_comment
@PEP8NormalizerConfig.register_rule
class FooRule(Rule):
pass
@PEP8NormalizerConfig.register_rule
@PEP8NormalizerConfig.register_rule(type='endmarker')
class BlankLineAtEnd(Rule):
code = 392
message = 'Blank line at end of file'
leaf_event = ['endmarker']
def check(self, leaf):
return self._newline_count >= 2