lgtm: fix Missing call to __init__ during object initialization
Either mark the missing calls as intentional, or explicetly call the right __init__ method and avoid mixing super() and explicit base calss calls.
This commit is contained in:
parent
268d59516f
commit
fe853ee516
|
@ -613,6 +613,7 @@ class GnuDCompiler(DCompiler, GnuCompiler):
|
||||||
def __init__(self, exelist, version, for_machine: MachineChoice,
|
def __init__(self, exelist, version, for_machine: MachineChoice,
|
||||||
info: 'MachineInfo', is_cross, exe_wrapper, arch, **kwargs):
|
info: 'MachineInfo', is_cross, exe_wrapper, arch, **kwargs):
|
||||||
DCompiler.__init__(self, exelist, version, for_machine, info, is_cross, exe_wrapper, arch, **kwargs)
|
DCompiler.__init__(self, exelist, version, for_machine, info, is_cross, exe_wrapper, arch, **kwargs)
|
||||||
|
GnuCompiler.__init__(self, {})
|
||||||
self.id = 'gcc'
|
self.id = 'gcc'
|
||||||
default_warn_args = ['-Wall', '-Wdeprecated']
|
default_warn_args = ['-Wall', '-Wdeprecated']
|
||||||
self.warn_args = {'0': [],
|
self.warn_args = {'0': [],
|
||||||
|
|
|
@ -1896,7 +1896,7 @@ class ExternalProgram:
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
|
||||||
class NonExistingExternalProgram(ExternalProgram):
|
class NonExistingExternalProgram(ExternalProgram): # lgtm [py/missing-call-to-init]
|
||||||
"A program that will never exist"
|
"A program that will never exist"
|
||||||
|
|
||||||
def __init__(self, name='nonexistingprogram'):
|
def __init__(self, name='nonexistingprogram'):
|
||||||
|
@ -1912,7 +1912,7 @@ class NonExistingExternalProgram(ExternalProgram):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
class EmptyExternalProgram(ExternalProgram):
|
class EmptyExternalProgram(ExternalProgram): # lgtm [py/missing-call-to-init]
|
||||||
'''
|
'''
|
||||||
A program object that returns an empty list of commands. Used for cases
|
A program object that returns an empty list of commands. Used for cases
|
||||||
such as a cross file exe_wrapper to represent that it's not required.
|
such as a cross file exe_wrapper to represent that it's not required.
|
||||||
|
|
|
@ -137,7 +137,7 @@ class IntelVisualStudioLinker(VisualStudioLikeLinker, StaticLinker):
|
||||||
class ArLinker(StaticLinker):
|
class ArLinker(StaticLinker):
|
||||||
|
|
||||||
def __init__(self, exelist: typing.List[str]):
|
def __init__(self, exelist: typing.List[str]):
|
||||||
super().__init__(exelist)
|
StaticLinker.__init__(self, exelist)
|
||||||
self.id = 'ar'
|
self.id = 'ar'
|
||||||
pc, stdo = mesonlib.Popen_safe(self.exelist + ['-h'])[0:2]
|
pc, stdo = mesonlib.Popen_safe(self.exelist + ['-h'])[0:2]
|
||||||
# Enable deterministic builds if they are available.
|
# Enable deterministic builds if they are available.
|
||||||
|
@ -153,7 +153,7 @@ class ArLinker(StaticLinker):
|
||||||
return [target]
|
return [target]
|
||||||
|
|
||||||
|
|
||||||
class ArmarLinker(ArLinker):
|
class ArmarLinker(ArLinker): # lgtm [py/missing-call-to-init]
|
||||||
|
|
||||||
def __init__(self, exelist: typing.List[str]):
|
def __init__(self, exelist: typing.List[str]):
|
||||||
StaticLinker.__init__(self, exelist)
|
StaticLinker.__init__(self, exelist)
|
||||||
|
@ -167,7 +167,7 @@ class ArmarLinker(ArLinker):
|
||||||
|
|
||||||
class DLinker(StaticLinker):
|
class DLinker(StaticLinker):
|
||||||
def __init__(self, exelist: typing.List[str], arch: str):
|
def __init__(self, exelist: typing.List[str], arch: str):
|
||||||
super().__init__(exelist)
|
StaticLinker.__init__(self, exelist)
|
||||||
self.id = exelist[0]
|
self.id = exelist[0]
|
||||||
self.arch = arch
|
self.arch = arch
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ class DLinker(StaticLinker):
|
||||||
class CcrxLinker(StaticLinker):
|
class CcrxLinker(StaticLinker):
|
||||||
|
|
||||||
def __init__(self, exelist: typing.List[str]):
|
def __init__(self, exelist: typing.List[str]):
|
||||||
super().__init__(exelist)
|
StaticLinker.__init__(self, exelist)
|
||||||
self.id = 'rlink'
|
self.id = 'rlink'
|
||||||
|
|
||||||
def can_linker_accept_rsp(self) -> bool:
|
def can_linker_accept_rsp(self) -> bool:
|
||||||
|
@ -682,7 +682,7 @@ class CcrxDynamicLinker(DynamicLinker):
|
||||||
|
|
||||||
def __init__(self, for_machine: mesonlib.MachineChoice,
|
def __init__(self, for_machine: mesonlib.MachineChoice,
|
||||||
*, version: str = 'unknown version'):
|
*, version: str = 'unknown version'):
|
||||||
super().__init__(['rlink.exe'], for_machine, 'rlink', '',
|
DynamicLinker.__init__(self, ['rlink.exe'], for_machine, 'rlink', '',
|
||||||
version=version)
|
version=version)
|
||||||
|
|
||||||
def get_accepts_rsp(self) -> bool:
|
def get_accepts_rsp(self) -> bool:
|
||||||
|
@ -715,7 +715,7 @@ class ArmDynamicLinker(PosixDynamicLinkerMixin, DynamicLinker):
|
||||||
|
|
||||||
def __init__(self, for_machine: mesonlib.MachineChoice,
|
def __init__(self, for_machine: mesonlib.MachineChoice,
|
||||||
*, version: str = 'unknown version'):
|
*, version: str = 'unknown version'):
|
||||||
super().__init__(['armlink'], for_machine, 'armlink', '',
|
DynamicLinker.__init__(self, ['armlink'], for_machine, 'armlink', '',
|
||||||
version=version)
|
version=version)
|
||||||
|
|
||||||
def get_accepts_rsp(self) -> bool:
|
def get_accepts_rsp(self) -> bool:
|
||||||
|
@ -773,7 +773,7 @@ class PGIDynamicLinker(PosixDynamicLinkerMixin, DynamicLinker):
|
||||||
|
|
||||||
class PGIStaticLinker(StaticLinker):
|
class PGIStaticLinker(StaticLinker):
|
||||||
def __init__(self, exelist: typing.List[str]):
|
def __init__(self, exelist: typing.List[str]):
|
||||||
super().__init__(exelist)
|
StaticLinker.__init__(self, exelist)
|
||||||
self.id = 'ar'
|
self.id = 'ar'
|
||||||
self.std_args = ['-r']
|
self.std_args = ['-r']
|
||||||
|
|
||||||
|
@ -796,8 +796,7 @@ class VisualStudioLikeLinkerMixin:
|
||||||
'custom': [],
|
'custom': [],
|
||||||
} # type: typing.Dict[str, typing.List[str]]
|
} # type: typing.Dict[str, typing.List[str]]
|
||||||
|
|
||||||
def __init__(self, *args, direct: bool = True, machine: str = 'x86', **kwargs):
|
def __init__(self, direct: bool = True, machine: str = 'x86'):
|
||||||
super().__init__(*args, **kwargs)
|
|
||||||
self.direct = direct
|
self.direct = direct
|
||||||
self.machine = machine
|
self.machine = machine
|
||||||
|
|
||||||
|
@ -857,8 +856,9 @@ class MSVCDynamicLinker(VisualStudioLikeLinkerMixin, DynamicLinker):
|
||||||
exelist: typing.Optional[typing.List[str]] = None,
|
exelist: typing.Optional[typing.List[str]] = None,
|
||||||
prefix: typing.Union[str, typing.List[str]] = '',
|
prefix: typing.Union[str, typing.List[str]] = '',
|
||||||
machine: str = 'x86', version: str = 'unknown version'):
|
machine: str = 'x86', version: str = 'unknown version'):
|
||||||
super().__init__(exelist or ['link.exe'], for_machine, 'link',
|
VisualStudioLikeLinkerMixin.__init__(self, machine=machine)
|
||||||
prefix, machine=machine, version=version)
|
DynamicLinker.__init__(self, exelist or ['link.exe'], for_machine, 'link',
|
||||||
|
prefix, version=version)
|
||||||
|
|
||||||
|
|
||||||
class ClangClDynamicLinker(VisualStudioLikeLinkerMixin, DynamicLinker):
|
class ClangClDynamicLinker(VisualStudioLikeLinkerMixin, DynamicLinker):
|
||||||
|
@ -869,7 +869,8 @@ class ClangClDynamicLinker(VisualStudioLikeLinkerMixin, DynamicLinker):
|
||||||
exelist: typing.Optional[typing.List[str]] = None,
|
exelist: typing.Optional[typing.List[str]] = None,
|
||||||
prefix: typing.Union[str, typing.List[str]] = '',
|
prefix: typing.Union[str, typing.List[str]] = '',
|
||||||
version: str = 'unknown version'):
|
version: str = 'unknown version'):
|
||||||
super().__init__(exelist or ['lld-link.exe'], for_machine,
|
VisualStudioLikeLinkerMixin.__init__(self)
|
||||||
|
DynamicLinker.__init__(self, exelist or ['lld-link.exe'], for_machine,
|
||||||
'lld-link', prefix, version=version)
|
'lld-link', prefix, version=version)
|
||||||
|
|
||||||
|
|
||||||
|
@ -879,7 +880,8 @@ class XilinkDynamicLinker(VisualStudioLikeLinkerMixin, DynamicLinker):
|
||||||
|
|
||||||
def __init__(self, for_machine: mesonlib.MachineChoice,
|
def __init__(self, for_machine: mesonlib.MachineChoice,
|
||||||
*, version: str = 'unknown version'):
|
*, version: str = 'unknown version'):
|
||||||
super().__init__(['xilink.exe'], for_machine, 'xilink', '', version=version)
|
VisualStudioLikeLinkerMixin.__init__(self)
|
||||||
|
DynamicLinker.__init__(self, ['xilink.exe'], for_machine, 'xilink', '', version=version)
|
||||||
|
|
||||||
|
|
||||||
class SolarisDynamicLinker(PosixDynamicLinkerMixin, DynamicLinker):
|
class SolarisDynamicLinker(PosixDynamicLinkerMixin, DynamicLinker):
|
||||||
|
@ -936,7 +938,8 @@ class OptlinkDynamicLinker(VisualStudioLikeLinkerMixin, DynamicLinker):
|
||||||
*, version: str = 'unknown version'):
|
*, version: str = 'unknown version'):
|
||||||
# Use optlink instead of link so we don't interfer with other link.exe
|
# Use optlink instead of link so we don't interfer with other link.exe
|
||||||
# implementations.
|
# implementations.
|
||||||
super().__init__(['optlink.exe'], for_machine, 'optlink', prefix_arg='', version=version)
|
VisualStudioLikeLinkerMixin.__init__(self)
|
||||||
|
DynamicLinker.__init__(self, ['optlink.exe'], for_machine, 'optlink', prefix_arg='', version=version)
|
||||||
|
|
||||||
def get_allow_undefined_args(self) -> typing.List[str]:
|
def get_allow_undefined_args(self) -> typing.List[str]:
|
||||||
return []
|
return []
|
||||||
|
|
Loading…
Reference in New Issue