Fix most newline issues.

This commit is contained in:
Dave Halter
2017-07-05 17:15:24 +02:00
parent 6d91bcefe6
commit fdad958b64
3 changed files with 45 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
from contextlib import contextmanager
from functools import total_ordering
class Normalizer(object):
@@ -15,7 +16,8 @@ class Normalizer(object):
def add_issue(self, code, message, node):
issue = Issue(node, code, message)
self.issues.append(issue)
if issue not in self.issues:
self.issues.append(issue)
return True
@@ -53,6 +55,16 @@ class Issue(object):
self.message = message
self.start_pos = node.start_pos
def __eq__(self, other):
return self.start_pos == other.start_pos and self.code == other.code
def __ne__(self, other):
return not self.__eq__(other)
def __hash__(self):
return hash((self.code, self.start_pos))
class Rule(object):
error_code = None