aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlf Henrik Sauge <alf.henrik.sauge@gmail.com>2022-08-11 21:32:41 +0200
committerEli Schwartz <eschwartz93@gmail.com>2022-08-26 17:12:40 -0400
commit28dff2ca6d71b22765d9eb78719bd0b6c3b55dee (patch)
tree11f8e482d55da4cb3dd72207209e64369e09f75a
parent9ad5d0df4a3ad8dcc9d5d270b83894d3c60dd095 (diff)
downloadmeson-28dff2ca6d71b22765d9eb78719bd0b6c3b55dee.zip
meson-28dff2ca6d71b22765d9eb78719bd0b6c3b55dee.tar.gz
meson-28dff2ca6d71b22765d9eb78719bd0b6c3b55dee.tar.bz2
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.
-rw-r--r--mesonbuild/interpreter/interpreter.py20
-rw-r--r--mesonbuild/modules/rust.py14
2 files changed, 20 insertions, 14 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index d80f5db..70cf2df 100644
--- a/mesonbuild/interpreter/interpreter.py
+++ b/mesonbuild/interpreter/interpreter.py
@@ -1829,20 +1829,22 @@ class Interpreter(InterpreterBase, HoldableObject):
self._validate_custom_target_outputs(len(kwargs['input']) > 1, kwargs['output'], "vcs_tag")
+ cmd = self.environment.get_build_command() + \
+ ['--internal',
+ 'vcstagger',
+ '@INPUT0@',
+ '@OUTPUT0@',
+ fallback,
+ source_dir,
+ replace_string,
+ regex_selector] + vcs_cmd
+
tg = build.CustomTarget(
kwargs['output'][0],
self.subdir,
self.subproject,
self.environment,
- self.environment.get_build_command() +
- ['--internal',
- 'vcstagger',
- '@INPUT0@',
- '@OUTPUT0@',
- fallback,
- source_dir,
- replace_string,
- regex_selector] + vcs_cmd,
+ cmd,
self.source_strings_to_files(kwargs['input']),
kwargs['output'],
build_by_default=True,
diff --git a/mesonbuild/modules/rust.py b/mesonbuild/modules/rust.py
index 792195e..bdbc3d0 100644
--- a/mesonbuild/modules/rust.py
+++ b/mesonbuild/modules/rust.py
@@ -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',