style: fix E128 violations

E128: continuation line under-indented for visual indent

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
pull/1255/head
Igor Gnatenko 8 years ago committed by Jussi Pakkanen
parent ea570bcb67
commit 116da33cdd
  1. 10
      mesonbuild/backend/ninjabackend.py
  2. 12
      mesonbuild/backend/vs2010backend.py
  3. 10
      mesonbuild/build.py
  4. 2
      mesonbuild/coredata.py
  5. 9
      mesonbuild/environment.py
  6. 10
      mesonbuild/interpreter.py
  7. 6
      mesonbuild/mconf.py
  8. 23
      mesonbuild/modules/gnome.py
  9. 4
      mesonbuild/scripts/gtkdochelper.py
  10. 2
      mesonbuild/wrap/wrap.py
  11. 4
      mesontest.py
  12. 2
      run_project_tests.py

@ -484,11 +484,11 @@ int dummy;
# a serialized executable wrapper for that and check if the
# CustomTarget command needs extra paths first.
if target.capture or (mesonlib.is_windows() and
self.determine_windows_extra_paths(target.command[0])):
self.determine_windows_extra_paths(target.command[0])):
exe_data = self.serialise_executable(target.command[0], cmd[1:],
# All targets are built from the build dir
self.environment.get_build_dir(),
capture=ofilenames[0] if target.capture else None)
# All targets are built from the build dir
self.environment.get_build_dir(),
capture=ofilenames[0] if target.capture else None)
cmd = [sys.executable, self.environment.get_build_command(),
'--internal', 'exe', exe_data]
cmd_type = 'meson_exe.py custom'
@ -1200,7 +1200,7 @@ int dummy;
elem.write(outfile)
if isinstance(target, build.StaticLibrary):
elem = self.generate_link(target, outfile, self.get_target_filename(target),
rel_objects, self.build.static_linker)
rel_objects, self.build.static_linker)
elem.write(outfile)
elif isinstance(target, build.Executable):
elem = NinjaBuildElement(self.all_outputs, self.get_target_filename(target), 'swift_COMPILER', [])

@ -462,18 +462,18 @@ class Vs2010Backend(backends.Backend):
def escape_preprocessor_define(define):
# See: https://msdn.microsoft.com/en-us/library/bb383819.aspx
table = str.maketrans({'%': '%25', '$': '%24', '@': '%40',
"'": '%27', ';': '%3B', '?': '%3F', '*': '%2A',
# We need to escape backslash because it'll be un-escaped by
# Windows during process creation when it parses the arguments
# Basically, this converts `\` to `\\`.
'\\': '\\\\'})
"'": '%27', ';': '%3B', '?': '%3F', '*': '%2A',
# We need to escape backslash because it'll be un-escaped by
# Windows during process creation when it parses the arguments
# Basically, this converts `\` to `\\`.
'\\': '\\\\'})
return define.translate(table)
@staticmethod
def escape_additional_option(option):
# See: https://msdn.microsoft.com/en-us/library/bb383819.aspx
table = str.maketrans({'%': '%25', '$': '%24', '@': '%40',
"'": '%27', ';': '%3B', '?': '%3F', '*': '%2A', ' ': '%20'})
"'": '%27', ';': '%3B', '?': '%3F', '*': '%2A', ' ': '%20'})
option = option.translate(table)
# Since we're surrounding the option with ", if it ends in \ that will
# escape the " when the process arguments are parsed and the starting

@ -731,12 +731,12 @@ class BuildTarget():
# This should be reliable enough.
if hasattr(dep, 'subproject'):
raise InvalidArguments('Tried to use subproject object as a dependency.\n'
'You probably wanted to use a dependency declared in it instead.\n'
'Access it by calling get_variable() on the subproject object.')
'You probably wanted to use a dependency declared in it instead.\n'
'Access it by calling get_variable() on the subproject object.')
raise InvalidArguments('Argument is of an unacceptable type {!r}.\nMust be '
'either an external dependency (returned by find_library() or '
'dependency()) or an internal dependency (returned by '
'declare_dependency()).'.format(type(dep).__name__))
'either an external dependency (returned by find_library() or '
'dependency()) or an internal dependency (returned by '
'declare_dependency()).'.format(type(dep).__name__))
def get_external_deps(self):
return self.external_deps

@ -159,7 +159,7 @@ def load(filename):
raise MesonException(load_fail_msg)
if obj.version != version:
raise MesonException('Build directory has been generated with Meson version %s, which is incompatible with current version %s.\nPlease delete this build directory AND create a new one.' %
(obj.version, version))
(obj.version, version))
return obj
def save(obj, filename):

@ -793,9 +793,12 @@ def get_args_from_envvars(compiler):
return ([], [])
# Compile flags
cflags_mapping = {'c': 'CFLAGS', 'cpp': 'CXXFLAGS',
'objc': 'OBJCFLAGS', 'objcpp': 'OBJCXXFLAGS',
'fortran': 'FFLAGS', 'd': 'DFLAGS'}
cflags_mapping = {'c': 'CFLAGS',
'cpp': 'CXXFLAGS',
'objc': 'OBJCFLAGS',
'objcpp': 'OBJCXXFLAGS',
'fortran': 'FFLAGS',
'd': 'DFLAGS'}
compile_flags = os.environ.get(cflags_mapping[lang], '')
log_var(cflags_mapping[lang], compile_flags)
compile_flags = compile_flags.split()

@ -499,7 +499,7 @@ class BuildTargetHolder(InterpreterObject):
def private_dir_include_method(self, args, kwargs):
return IncludeDirsHolder(build.IncludeDirs('', [], False,
[self.interpreter.backend.get_target_private_dir(self.held_object)]))
[self.interpreter.backend.get_target_private_dir(self.held_object)]))
def full_path_method(self, args, kwargs):
return self.interpreter.backend.get_target_filename_abs(self.held_object)
@ -1774,8 +1774,8 @@ requirements use the version keyword argument instead.''')
# exception; let the caller handle things.
except:
mlog.log('Also couldn\'t find a fallback subproject in',
mlog.bold(os.path.join(self.subproject_dir, dirname)),
'for the dependency', mlog.bold(name))
mlog.bold(os.path.join(self.subproject_dir, dirname)),
'for the dependency', mlog.bold(name))
return None
try:
dep = self.subprojects[dirname].get_variable_method([varname], {})
@ -1792,8 +1792,8 @@ requirements use the version keyword argument instead.''')
found = dep.version_method([], {})
if found == 'undefined' or not mesonlib.version_compare(found, wanted):
mlog.log('Subproject', mlog.bold(dirname), 'dependency',
mlog.bold(varname), 'version is', mlog.bold(found),
'but', mlog.bold(wanted), 'is required.')
mlog.bold(varname), 'version is', mlog.bold(found),
'but', mlog.bold(wanted), 'is required.')
return None
mlog.log('Found a', mlog.green('fallback'), 'subproject',
mlog.bold(os.path.join(self.subproject_dir, dirname)), 'for',

@ -130,7 +130,7 @@ class Conf:
carr = []
for key in [ 'buildtype', 'warning_level', 'werror', 'strip', 'unity', 'default_library' ]:
carr.append([key, coredata.get_builtin_option_description(key),
self.coredata.get_builtin_option(key), coredata.get_builtin_option_choices(key)])
self.coredata.get_builtin_option(key), coredata.get_builtin_option_choices(key)])
self.print_aligned(carr)
print('')
print('Base options:')
@ -180,7 +180,7 @@ class Conf:
'sharedstatedir',
]:
parr.append([key, coredata.get_builtin_option_description(key),
self.coredata.get_builtin_option(key), coredata.get_builtin_option_choices(key)])
self.coredata.get_builtin_option(key), coredata.get_builtin_option_choices(key)])
self.print_aligned(parr)
print('')
print('Project options:')
@ -206,7 +206,7 @@ class Conf:
tarr = []
for key in [ 'stdsplit', 'errorlogs' ]:
tarr.append([key, coredata.get_builtin_option_description(key),
self.coredata.get_builtin_option(key), coredata.get_builtin_option_choices(key)])
self.coredata.get_builtin_option(key), coredata.get_builtin_option_choices(key)])
self.print_aligned(tarr)
def run(args):

@ -292,7 +292,7 @@ can not be used with the current version of glib-compiled-resources, due to
for source in dep.sources:
if hasattr(source, 'held_object') and isinstance(source.held_object, GirTarget):
gi_includes.update([os.path.join(state.environment.get_build_dir(),
source.held_object.get_subdir())])
source.held_object.get_subdir())])
# This should be any dependency other than an internal one.
elif isinstance(dep, Dependency):
cflags.update(dep.get_compile_args())
@ -511,7 +511,7 @@ can not be used with the current version of glib-compiled-resources, due to
if kwargs.get('install'):
scankwargs['install'] = kwargs['install']
scankwargs['install_dir'] = kwargs.get('install_dir_gir',
os.path.join(state.environment.get_datadir(), 'gir-1.0'))
os.path.join(state.environment.get_datadir(), 'gir-1.0'))
scan_target = GirTarget(girfile, state.subdir, scankwargs)
typelib_output = '%s-%s.typelib' % (ns, nsversion)
@ -528,7 +528,7 @@ can not be used with the current version of glib-compiled-resources, due to
if kwargs.get('install'):
typelib_kwargs['install'] = kwargs['install']
typelib_kwargs['install_dir'] = kwargs.get('install_dir_typelib',
os.path.join(state.environment.get_libdir(), 'girepository-1.0'))
os.path.join(state.environment.get_libdir(), 'girepository-1.0'))
typelib_target = TypelibTarget(typelib_output, state.subdir, typelib_kwargs)
return [scan_target, typelib_target]
@ -575,13 +575,12 @@ can not be used with the current version of glib-compiled-resources, due to
script = [sys.executable, state.environment.get_build_command()]
args = ['--internal',
'yelphelper',
'install',
'--subdir=' + state.subdir,
'--id=' + project_id,
'--installdir=' + os.path.join(state.environment.get_datadir(), 'help'),
'--sources=' + source_str,
]
'yelphelper',
'install',
'--subdir=' + state.subdir,
'--id=' + project_id,
'--installdir=' + os.path.join(state.environment.get_datadir(), 'help'),
'--sources=' + source_str]
if symlinks:
args.append('--symlinks=true')
if media:
@ -1035,8 +1034,8 @@ can not be used with the current version of glib-compiled-resources, due to
'depends': vapi_depends,
}
install_dir = kwargs.get('install_dir',
os.path.join(state.environment.coredata.get_builtin_option('datadir'),
'vala', 'vapi'))
os.path.join(state.environment.coredata.get_builtin_option('datadir'),
'vala', 'vapi'))
if kwargs.get('install'):
custom_kwargs['install'] = kwargs['install']
custom_kwargs['install_dir'] = install_dir

@ -108,7 +108,9 @@ def build_gtkdoc(source_root, build_root, doc_subdir, src_subdirs,
if gobject_typesfile:
scanobjs_cmd = ['gtkdoc-scangobj'] + scanobjs_args + [gobject_typesfile,
'--module=' + module, '--cflags=' + cflags, '--ldflags=' + ldflags]
'--module=' + module,
'--cflags=' + cflags,
'--ldflags=' + ldflags]
gtkdoc_run_check(scanobjs_cmd, abs_out)

@ -99,7 +99,7 @@ class Resolver:
return packagename
else:
mlog.warning('Subproject directory %s is empty, possibly because of an unfinished'
'checkout, removing to reclone' % dirname)
'checkout, removing to reclone' % dirname)
os.rmdir(dirname)
except NotADirectoryError:
raise RuntimeError('%s is not a directory, can not use as subproject.' % dirname)

@ -349,7 +349,7 @@ class TestHarness:
jsonlogfile = open(jsonlogfilename, 'w')
logfile = open(logfilename, 'w')
logfile.write('Log of Meson test suite run on %s.\n\n' %
datetime.datetime.now().isoformat())
datetime.datetime.now().isoformat())
for i in range(self.options.repeat):
for i, test in enumerate(filtered_tests):
@ -367,7 +367,7 @@ class TestHarness:
res = self.run_single_test(wrap, test)
if not self.options.verbose:
self.print_stats(numlen, filtered_tests, visible_name, res, i,
logfile, jsonlogfile)
logfile, jsonlogfile)
else:
f = executor.submit(self.run_single_test, wrap, test)
if not self.options.verbose:

@ -518,7 +518,7 @@ def generate_prebuilt():
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="Run the test suite of Meson.")
parser.add_argument('extra_args', nargs='*',
help='arguments that are passed directly to Meson (remember to have -- before these).')
help='arguments that are passed directly to Meson (remember to have -- before these).')
parser.add_argument('--backend', default=None, dest='backend',
choices = backendlist)
options = parser.parse_args()

Loading…
Cancel
Save