1
0
forked from VimPlug/jedi

First static analysis test working.

This commit is contained in:
Dave Halter
2014-12-11 15:42:16 +01:00
parent 6afc5ccca5
commit 6406bfb3c2
2 changed files with 3 additions and 12 deletions

View File

@@ -618,9 +618,8 @@ class Script(object):
if i.is_nested() and any(not isinstance(i, pr.Module) for i in iw):
analysis.add(self._evaluator, 'import-error', i.namespace_names[-1])
for stmt in sorted(stmts, key=lambda obj: obj.start_pos):
if not (isinstance(stmt.parent, pr.ForFlow)
and stmt.parent.set_stmt == stmt):
self._evaluator.eval_statement(stmt)
#if not (isinstance(stmt.parent, pr.ForFlow) and stmt.parent.set_stmt == stmt):
self._evaluator.eval_statement(stmt)
ana = [a for a in self._evaluator.analysis if self.path == a.path]
return sorted(set(ana), key=lambda x: x.line)

View File

@@ -74,7 +74,7 @@ class Warning(Error):
def add(evaluator, name, jedi_obj, message=None, typ=Error, payload=None):
exception = CODES[name][1]
if True or _check_for_exception_catch(evaluator, jedi_obj, exception, payload):
if _check_for_exception_catch(evaluator, jedi_obj, exception, payload):
return
module_path = jedi_obj.get_parent_until().path
@@ -208,14 +208,6 @@ def get_module_statements(module):
if stmt is None:
continue
for expression in stmt.expression_list():
if isinstance(expression, pr.Array):
new |= add_stmts(expression.values)
if isinstance(expression, pr.StatementElement):
for element in expression.generate_call_path():
if isinstance(element, pr.Array):
new |= add_stmts(element.values)
new.add(stmt)
return new