style: [E1**] Indentation

pull/1257/head
Mike Sinkovsky 8 years ago committed by Jussi Pakkanen
parent 0dd1e33898
commit 5b626ab4cb
  1. 10
      mesonbuild/backend/ninjabackend.py
  2. 6
      mesonbuild/build.py
  3. 9
      mesonbuild/compilers.py
  4. 48
      mesonbuild/coredata.py
  5. 8
      mesonbuild/dependencies.py
  6. 2
      mesonbuild/environment.py
  7. 4
      mesonbuild/interpreter.py
  8. 6
      mesonbuild/mparser.py
  9. 4
      mesonbuild/scripts/__init__.py
  10. 4
      mesontest.py
  11. 5
      tools/cmake2meson.py

@ -317,7 +317,7 @@ int dummy;
# Sources consumed by valac are filtered out. These only contain
# C/C++ sources, objects, generated libs, and unknown sources now.
target_sources, generated_sources, \
vala_generated_sources = self.generate_vala_compile(target, outfile)
vala_generated_sources = self.generate_vala_compile(target, outfile)
else:
target_sources = self.get_target_sources(target)
generated_sources = self.get_target_generated_sources(target)
@ -1257,8 +1257,10 @@ int dummy;
ctypes.append((self.build.cross_compilers, True))
for (complist, is_cross) in ctypes:
for langname, compiler in complist.items():
if langname == 'java' or langname == 'vala' or\
langname == 'rust' or langname == 'cs':
if langname == 'java' \
or langname == 'vala' \
or langname == 'rust' \
or langname == 'cs':
continue
crstr = ''
cross_args = []
@ -1617,7 +1619,7 @@ rule FORTRAN_DEP_HACK
raise InvalidArguments(
'Namespace collision: module %s defined in '
'two files %s and %s.' %
(modname, module_files[modname], s))
(modname, module_files[modname], s))
module_files[modname] = s
self.fortran_deps[target.get_basename()] = module_files

@ -289,9 +289,9 @@ class BuildTarget():
self.process_objectlist(objects)
self.process_kwargs(kwargs, environment)
self.check_unknown_kwargs(kwargs)
if len(self.sources) == 0 and \
len(self.generated) == 0 and \
len(self.objects) == 0:
if len(self.sources) == 0 \
and len(self.generated) == 0 \
and len(self.objects) == 0:
raise InvalidArguments('Build target %s has no sources.' % name)
self.process_compilers()
self.validate_sources()

@ -187,8 +187,7 @@ gnu_color_args = {'auto': ['-fdiagnostics-color=auto'],
'never': ['-fdiagnostics-color=never'],
}
base_options = {
'b_pch': coredata.UserBooleanOption('b_pch', 'Use precompiled headers', True),
base_options = {'b_pch': coredata.UserBooleanOption('b_pch', 'Use precompiled headers', True),
'b_lto': coredata.UserBooleanOption('b_lto', 'Use link time optimization', False),
'b_sanitize': coredata.UserComboOption('b_sanitize',
'Code sanitizer to use',
@ -2168,8 +2167,7 @@ class GnuCCompiler(GnuCompiler, CCompiler):
if self.gcc_type == GCC_MINGW:
opts.update({
'c_winlibs': coredata.UserStringArrayOption('c_winlibs', 'Standard Win libraries to link against',
gnu_winlibs),
})
gnu_winlibs), })
return opts
def get_option_compile_args(self, options):
@ -2208,8 +2206,7 @@ class GnuCPPCompiler(GnuCompiler, CPPCompiler):
if self.gcc_type == GCC_MINGW:
opts.update({
'cpp_winlibs': coredata.UserStringArrayOption('cpp_winlibs', 'Standard Win libraries to link against',
gnu_winlibs),
})
gnu_winlibs), })
return opts
def get_option_compile_args(self, options):

@ -201,19 +201,19 @@ def get_builtin_option_default(optname):
raise RuntimeError('Tried to get the default value for an unknown builtin option \'%s\'.' % optname)
builtin_options = {
'buildtype': [UserComboOption, 'Build type to use.', ['plain', 'debug', 'debugoptimized', 'release', 'minsize'], 'debug'],
'strip': [UserBooleanOption, 'Strip targets on install.', False],
'unity': [UserBooleanOption, 'Unity build.', False],
'prefix': [UserStringOption, 'Installation prefix.', default_prefix()],
'libdir': [UserStringOption, 'Library directory.', default_libdir()],
'libexecdir': [UserStringOption, 'Library executable directory.', default_libexecdir()],
'bindir': [UserStringOption, 'Executable directory.', 'bin'],
'sbindir': [UserStringOption, 'System executable directory.', 'sbin'],
'includedir': [UserStringOption, 'Header file directory.', 'include'],
'datadir': [UserStringOption, 'Data file directory.', 'share'],
'mandir': [UserStringOption, 'Manual page directory.', 'share/man'],
'infodir': [UserStringOption, 'Info page directory.', 'share/info'],
'localedir': [UserStringOption, 'Locale data directory.', 'share/locale'],
'buildtype': [UserComboOption, 'Build type to use.', ['plain', 'debug', 'debugoptimized', 'release', 'minsize'], 'debug'],
'strip': [UserBooleanOption, 'Strip targets on install.', False],
'unity': [UserBooleanOption, 'Unity build.', False],
'prefix': [UserStringOption, 'Installation prefix.', default_prefix()],
'libdir': [UserStringOption, 'Library directory.', default_libdir()],
'libexecdir': [UserStringOption, 'Library executable directory.', default_libexecdir()],
'bindir': [UserStringOption, 'Executable directory.', 'bin'],
'sbindir': [UserStringOption, 'System executable directory.', 'sbin'],
'includedir': [UserStringOption, 'Header file directory.', 'include'],
'datadir': [UserStringOption, 'Data file directory.', 'share'],
'mandir': [UserStringOption, 'Manual page directory.', 'share/man'],
'infodir': [UserStringOption, 'Info page directory.', 'share/info'],
'localedir': [UserStringOption, 'Locale data directory.', 'share/locale'],
# sysconfdir, localstatedir and sharedstatedir are a bit special. These defaults to ${prefix}/etc,
# ${prefix}/var and ${prefix}/com but nobody uses that. Instead they always set it
# manually to /etc, /var and /var/lib. This default values is thus pointless and not really used
@ -223,17 +223,17 @@ builtin_options = {
# to set the following in project():
#
# default_options : ['sysconfdir=/etc', 'localstatedir=/var', 'sharedstatedir=/var/lib']
'sysconfdir': [UserStringOption, 'Sysconf data directory.', 'etc'],
'localstatedir': [UserStringOption, 'Localstate data directory.', 'var'],
'sharedstatedir': [UserStringOption, 'Architecture-independent data directory.', 'com'],
'werror': [UserBooleanOption, 'Treat warnings as errors.', False],
'warning_level': [UserComboOption, 'Compiler warning level to use.', ['1', '2', '3'], '1'],
'layout': [UserComboOption, 'Build directory layout.', ['mirror', 'flat'], 'mirror'],
'default_library': [UserComboOption, 'Default library type.', ['shared', 'static'], 'shared'],
'backend': [UserComboOption, 'Backend to use.', backendlist, 'ninja'],
'stdsplit': [UserBooleanOption, 'Split stdout and stderr in test logs.', True],
'errorlogs': [UserBooleanOption, "Whether to print the logs from failing tests.", True],
}
'sysconfdir': [UserStringOption, 'Sysconf data directory.', 'etc'],
'localstatedir': [UserStringOption, 'Localstate data directory.', 'var'],
'sharedstatedir': [UserStringOption, 'Architecture-independent data directory.', 'com'],
'werror': [UserBooleanOption, 'Treat warnings as errors.', False],
'warning_level': [UserComboOption, 'Compiler warning level to use.', ['1', '2', '3'], '1'],
'layout': [UserComboOption, 'Build directory layout.', ['mirror', 'flat'], 'mirror'],
'default_library': [UserComboOption, 'Default library type.', ['shared', 'static'], 'shared'],
'backend': [UserComboOption, 'Backend to use.', backendlist, 'ninja'],
'stdsplit': [UserBooleanOption, 'Split stdout and stderr in test logs.', True],
'errorlogs': [UserBooleanOption, "Whether to print the logs from failing tests.", True],
}
forbidden_target_names = {'clean': None,
'clean-ctlist': None,

@ -1109,9 +1109,11 @@ why. As a hack filter out everything that is not a flag."""
as -O2 and so on. Drop everything that is not needed."""
result = []
for f in args:
if f.startswith('-D') or f.startswith('-f') or \
f.startswith('-I') or f == '-pthread' or\
(f.startswith('-W') and not f == '-Wall'):
if f.startswith('-D') \
or f.startswith('-f') \
or f.startswith('-I') \
or f == '-pthread' \
or (f.startswith('-W') and not f == '-Wall'):
result.append(f)
return result

@ -231,7 +231,7 @@ class Environment():
# Versioning is added to these names in the backends as-needed.
cross = self.is_cross_build()
if (not cross and mesonlib.is_windows()) \
or (cross and self.cross_info.has_host() and self.cross_info.config['host_machine']['system'] == 'windows'):
or (cross and self.cross_info.has_host() and self.cross_info.config['host_machine']['system'] == 'windows'):
self.exe_suffix = 'exe'
self.object_suffix = 'obj'
self.win_libdir_layout = True

@ -2446,8 +2446,8 @@ requirements use the version keyword argument instead.''')
def add_cross_stdlib_info(self, target):
for l in self.get_used_languages(target):
if self.environment.cross_info.has_stdlib(l) and \
self.subproject != self.environment.cross_info.get_stdlib(l)[0]:
if self.environment.cross_info.has_stdlib(l) \
and self.subproject != self.environment.cross_info.get_stdlib(l)[0]:
target.add_deps(self.build.cross_stdlibs[l])
def check_sources_exist(self, subdir, sources):

@ -107,8 +107,10 @@ class Lexer:
elif tid == 'dblquote':
raise ParseException('Double quotes are not supported. Use single quotes.', lineno, col)
elif tid == 'string':
value = match_text[1:-1].replace(r"\'", "'").replace(r" \\ ".strip(), r" \ ".strip())\
.replace("\\n", "\n")
value = match_text[1:-1]\
.replace(r"\'", "'")\
.replace(r" \\ ".strip(), r" \ ".strip())\
.replace("\\n", "\n")
elif tid == 'multiline_string':
tid = 'string'
value = match_text[3:-3]

@ -14,7 +14,7 @@
def destdir_join(d1, d2):
# c:\destdir + c:\prefix must produce c:\destdir\prefix
if len(d1) > 1 and d1[1] == ':' and \
len(d2) > 1 and d2[1] == ':':
if len(d1) > 1 and d1[1] == ':' \
and len(d2) > 1 and d2[1] == ':':
return d1 + d2[2:]
return d1 + d2

@ -281,8 +281,8 @@ class TestHarness:
(num, name, padding1, result.res, padding2, result.duration)
print(result_str)
result_str += "\n\n" + result.get_log()
if (result.returncode != GNU_SKIP_RETURNCODE) and \
(result.returncode != 0) != result.should_fail:
if (result.returncode != GNU_SKIP_RETURNCODE) \
and (result.returncode != 0) != result.should_fail:
if self.options.print_errorlogs:
self.collected_logs.append(result_str)
if logfile:

@ -121,8 +121,9 @@ class Parser():
args.append(self.arguments())
self.expect('rparen')
arg = self.current
if self.accept('string') or self.accept('varexp') or\
self.accept('id'):
if self.accept('string') \
or self.accept('varexp') \
or self.accept('id'):
args.append(arg)
rest = self.arguments()
args += rest

Loading…
Cancel
Save