Fix indentation issues reported by flake8, requiring code restructuring

Strictly speaking code restructuring isn't needed, but making this PEP8
compliant results in indentation of the code that reduces the
readability. By moving the offending code on the outside of the method
call, the readability is maintained.
pull/10746/head
Alf Henrik Sauge 2 years ago committed by Eli Schwartz
parent 9ad5d0df4a
commit 28dff2ca6d
  1. 16
      mesonbuild/interpreter/interpreter.py
  2. 14
      mesonbuild/modules/rust.py

@ -1829,12 +1829,7 @@ class Interpreter(InterpreterBase, HoldableObject):
self._validate_custom_target_outputs(len(kwargs['input']) > 1, kwargs['output'], "vcs_tag")
tg = build.CustomTarget(
kwargs['output'][0],
self.subdir,
self.subproject,
self.environment,
self.environment.get_build_command() +
cmd = self.environment.get_build_command() + \
['--internal',
'vcstagger',
'@INPUT0@',
@ -1842,7 +1837,14 @@ class Interpreter(InterpreterBase, HoldableObject):
fallback,
source_dir,
replace_string,
regex_selector] + vcs_cmd,
regex_selector] + vcs_cmd
tg = build.CustomTarget(
kwargs['output'][0],
self.subdir,
self.subproject,
self.environment,
cmd,
self.source_strings_to_files(kwargs['input']),
kwargs['output'],
build_by_default=True,

@ -210,16 +210,20 @@ class RustModule(ExtensionModule):
else:
name = header.get_outputs()[0]
cmd = self._bindgen_bin.get_command() + \
[
'@INPUT@', '--output',
os.path.join(state.environment.build_dir, '@OUTPUT@')
] + \
kwargs['args'] + ['--'] + kwargs['c_args'] + inc_strs + \
['-MD', '-MQ', '@INPUT@', '-MF', '@DEPFILE@']
target = CustomTarget(
f'rustmod-bindgen-{name}'.replace('/', '_'),
state.subdir,
state.subproject,
state.environment,
self._bindgen_bin.get_command() + [
'@INPUT@', '--output',
os.path.join(state.environment.build_dir, '@OUTPUT@')] +
kwargs['args'] + ['--'] + kwargs['c_args'] + inc_strs +
['-MD', '-MQ', '@INPUT@', '-MF', '@DEPFILE@'],
cmd,
[header],
[kwargs['output']],
depfile='@PLAINNAME@.d',

Loading…
Cancel
Save