forked from VimPlug/jedi
statical analysis shouldn't report the exact same error twice
This commit is contained in:
@@ -594,7 +594,7 @@ class Script(object):
|
|||||||
self._evaluator.eval_statement(stmt)
|
self._evaluator.eval_statement(stmt)
|
||||||
|
|
||||||
analysis = [a for a in self._evaluator.analysis if self.path == a.path]
|
analysis = [a for a in self._evaluator.analysis if self.path == a.path]
|
||||||
return sorted(analysis, key=lambda x: x.line)
|
return sorted(set(analysis), key=lambda x: x.line)
|
||||||
|
|
||||||
|
|
||||||
class Interpreter(Script):
|
class Interpreter(Script):
|
||||||
|
|||||||
@@ -37,6 +37,16 @@ class Error(object):
|
|||||||
def __str__(self):
|
def __str__(self):
|
||||||
return '%s: %s:%s' % (self.code, self.line, self.description())
|
return '%s: %s:%s' % (self.code, self.line, self.description())
|
||||||
|
|
||||||
|
def __eq__(self, other):
|
||||||
|
return (self.path == other.path and self.name == other.name
|
||||||
|
and self._start_pos == other._start_pos)
|
||||||
|
|
||||||
|
def __ne__(self, other):
|
||||||
|
return not self.__eq__(other)
|
||||||
|
|
||||||
|
def __hash__(self):
|
||||||
|
return hash((self.path, self._start_pos, self.name))
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return '<%s %s: %s@%s,%s' % (self.__class__.__name__,
|
return '<%s %s: %s@%s,%s' % (self.__class__.__name__,
|
||||||
self.name, self.path,
|
self.name, self.path,
|
||||||
|
|||||||
Reference in New Issue
Block a user