lgtm: ignore all safe `__init__ method calls overridden method` warnings

pull/6289/head
Daniel Mensinger 5 years ago committed by Jussi Pakkanen
parent 0c875e16c4
commit b5cec1c632
  1. 4
      mesonbuild/dependencies/base.py
  2. 4
      mesonbuild/rewriter.py

@ -1714,7 +1714,9 @@ class ExternalProgram:
break
if not silent:
if self.found():
# ignore the warning because derived classes never call this __init__
# method, and thus only the found() method of this class is ever executed
if self.found(): # lgtm [py/init-calls-subclass]
mlog.log('Program', mlog.bold(name), 'found:', mlog.green('YES'),
'(%s)' % ' '.join(self.command))
else:

@ -103,11 +103,11 @@ class RequiredKeys:
class MTypeBase:
def __init__(self, node: Optional[BaseNode] = None):
if node is None:
self.node = self._new_node()
self.node = self._new_node() # lgtm [py/init-calls-subclass] (node creation does not depend on base class state)
else:
self.node = node
self.node_type = None
for i in self.supported_nodes():
for i in self.supported_nodes(): # lgtm [py/init-calls-subclass] (listing nodes does not depend on base class state)
if isinstance(self.node, i):
self.node_type = i

Loading…
Cancel
Save