style: fix E226 violations

E226: missing whitespace around arithmetic operator

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
pull/1255/head
Igor Gnatenko 8 years ago committed by Jussi Pakkanen
parent f0b30baa39
commit 2017d8578a
  1. 2
      mesonbuild/backend/ninjabackend.py
  2. 6
      mesonbuild/backend/vs2010backend.py
  3. 2
      mesonbuild/backend/xcodebackend.py
  4. 20
      mesonbuild/compilers.py
  5. 10
      mesonbuild/mconf.py
  6. 2
      mesonbuild/modules/gnome.py
  7. 2
      mesonbuild/mparser.py
  8. 24
      mesonbuild/scripts/depfixer.py
  9. 4
      mesonbuild/scripts/meson_install.py
  10. 2
      mesonbuild/scripts/symbolextractor.py
  11. 4
      mesonbuild/scripts/yelphelper.py
  12. 4
      mesonbuild/wrap/wrap.py
  13. 10
      mesontest.py
  14. 4
      run_project_tests.py
  15. 2
      test cases/common/129 object only target/obj_generator.py
  16. 2
      test cases/common/59 object generator/obj_generator.py
  17. 4
      tools/cmake2meson.py

@ -796,7 +796,7 @@ int dummy;
class_list.append(plain_class_path)
class_dep_list = [os.path.join(self.get_target_private_dir(target), i) for i in class_list]
jar_rule = 'java_LINKER'
commands = [c+m+e+f]
commands = [c + m + e + f]
if e != '':
commands.append(main_class)
commands.append(self.get_target_filename(target))

@ -320,7 +320,7 @@ class Vs2010Backend(backends.Backend):
return ''
directories = os.path.normpath(target.subdir).split(os.sep)
return os.sep.join(['..']*len(directories))
return os.sep.join(['..'] * len(directories))
def special_quote(self, arr):
return ['&quot;%s&quot;' % i for i in arr]
@ -380,7 +380,7 @@ class Vs2010Backend(backends.Backend):
cmd += i.fullpath
else:
cmd.append(i)
cmd_templ = '''"%s" '''*len(cmd)
cmd_templ = '''"%s" ''' * len(cmd)
ET.SubElement(customstep, 'Command').text = cmd_templ % tuple(cmd)
ET.SubElement(customstep, 'Message').text = 'Running custom command.'
ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.targets')
@ -395,7 +395,7 @@ class Vs2010Backend(backends.Backend):
# from the target dir, not the build root.
target.absolute_paths = True
(srcs, ofilenames, cmd) = self.eval_custom_target_command(target, True)
cmd_templ = '''"%s" '''*len(cmd)
cmd_templ = '''"%s" ''' * len(cmd)
ET.SubElement(customstep, 'Command').text = cmd_templ % tuple(cmd)
ET.SubElement(customstep, 'Outputs').text = ';'.join(ofilenames)
ET.SubElement(customstep, 'Inputs').text = ';'.join(srcs)

@ -60,7 +60,7 @@ class XCodeBackend(backends.Backend):
return dirname
def write_line(self, text):
self.ofile.write(self.indent*self.indent_level + text)
self.ofile.write(self.indent * self.indent_level + text)
if not text.endswith('\n'):
self.ofile.write('\n')

@ -307,7 +307,7 @@ def build_unix_rpath_args(build_dir, rpath_paths, install_rpath):
return []
paths = ':'.join([os.path.join(build_dir, p) for p in rpath_paths])
if len(paths) < len(install_rpath):
padding = 'X'*(len(install_rpath) - len(paths))
padding = 'X' * (len(install_rpath) - len(paths))
if len(paths) == 0:
paths = padding
else:
@ -651,7 +651,7 @@ class CCompiler(Compiler):
return os.path.split(header_name)[-1] + '.' + self.get_pch_suffix()
def get_linker_search_args(self, dirname):
return ['-L'+dirname]
return ['-L' + dirname]
def gen_import_library_args(self, implibname):
"""
@ -1654,7 +1654,7 @@ class DCompiler(Compiler):
return []
paths = ':'.join([os.path.join(build_dir, p) for p in rpath_paths])
if len(paths) < len(install_rpath):
padding = 'X'*(len(install_rpath) - len(paths))
padding = 'X' * (len(install_rpath) - len(paths))
if len(paths) == 0:
paths = padding
else:
@ -1671,7 +1671,7 @@ class DCompiler(Compiler):
if arg == '-pthread':
continue
if arg.startswith('-Wl,'):
linkargs = arg[arg.index(',')+1:].split(',')
linkargs = arg[arg.index(',') + 1:].split(',')
for la in linkargs:
dcargs.append('-L' + la.strip())
continue
@ -1716,7 +1716,7 @@ class GnuDCompiler(DCompiler):
return ['-Werror']
def get_linker_search_args(self, dirname):
return ['-L'+dirname]
return ['-L' + dirname]
def get_buildtype_args(self, buildtype):
return d_gdc_buildtype_args[buildtype]
@ -1774,7 +1774,7 @@ class LLVMDCompiler(DCompiler):
# -L is recognized as "add this to the search path" by the linker,
# while the compiler recognizes it as "pass to linker". So, the first
# -L is for the compiler, telling it to pass the second -L to the linker.
return ['-L-L'+dirname]
return ['-L-L' + dirname]
def unix_link_flags_to_native(self, args):
return self.translate_args_to_nongnu(args)
@ -1820,7 +1820,7 @@ class DmdDCompiler(DCompiler):
# -L is recognized as "add this to the search path" by the linker,
# while the compiler recognizes it as "pass to linker". So, the first
# -L is for the compiler, telling it to pass the second -L to the linker.
return ['-L-L'+dirname]
return ['-L-L' + dirname]
def get_buildtype_args(self, buildtype):
return d_dmd_buildtype_args[buildtype]
@ -1997,7 +1997,7 @@ class VisualStudioCCompiler(CCompiler):
def has_multi_arguments(self, args, env):
warning_text = '9002'
code = 'int i;\n'
(fd, srcname) = tempfile.mkstemp(suffix='.'+self.default_suffix)
(fd, srcname) = tempfile.mkstemp(suffix='.' + self.default_suffix)
os.close(fd)
with open(srcname, 'w') as ofile:
ofile.write(code)
@ -2523,7 +2523,7 @@ class G95FortranCompiler(FortranCompiler):
self.id = 'g95'
def get_module_outdir_args(self, path):
return ['-fmod='+path]
return ['-fmod=' + path]
def get_always_args(self):
return ['-pipe']
@ -2555,7 +2555,7 @@ class SunFortranCompiler(FortranCompiler):
return []
def get_module_outdir_args(self, path):
return ['-moddir='+path]
return ['-moddir=' + path]
class IntelFortranCompiler(FortranCompiler):
std_warn_args = ['-warn', 'all']

@ -67,8 +67,8 @@ class Conf:
if longest_possible_value > 0:
titles[3] = 'Possible Values'
print(' %s%s %s%s %s%s %s' % (titles[0], ' '*(longest_name - len(titles[0])), titles[1], ' '*(longest_descr - len(titles[1])), titles[2], ' '*(longest_value - len(titles[2])), titles[3]))
print(' %s%s %s%s %s%s %s' % ('-'*len(titles[0]), ' '*(longest_name - len(titles[0])), '-'*len(titles[1]), ' '*(longest_descr - len(titles[1])), '-'*len(titles[2]), ' '*(longest_value - len(titles[2])), '-'*len(titles[3])))
print(' %s%s %s%s %s%s %s' % (titles[0], ' ' * (longest_name - len(titles[0])), titles[1], ' ' * (longest_descr - len(titles[1])), titles[2], ' ' * (longest_value - len(titles[2])), titles[3]))
print(' %s%s %s%s %s%s %s' % ('-' * len(titles[0]), ' ' * (longest_name - len(titles[0])), '-' * len(titles[1]), ' ' * (longest_descr - len(titles[1])), '-' * len(titles[2]), ' ' * (longest_value - len(titles[2])), '-' * len(titles[3])))
for i in arr:
name = i[0]
descr = i[1]
@ -80,9 +80,9 @@ class Conf:
possible_values = '[%s]' % ', '.join(map(str, i[3]))
elif i[3]:
possible_values = i[3] if isinstance(i[3], str) else str(i[3]).lower()
namepad = ' '*(longest_name - len(name))
descrpad = ' '*(longest_descr - len(descr))
valuepad = ' '*(longest_value - len(str(value)))
namepad = ' ' * (longest_name - len(name))
descrpad = ' ' * (longest_descr - len(descr))
valuepad = ' ' * (longest_value - len(str(value)))
f = ' %s%s %s%s %s%s %s' % (name, namepad, descr, descrpad, value, valuepad, possible_values)
print(f)

@ -362,7 +362,7 @@ can not be used with the current version of glib-compiled-resources, due to
scan_command = giscanner.get_command() + ['@INPUT@']
scan_command += pkgargs
scan_command += ['--no-libtool', '--namespace='+ns, '--nsversion=' + nsversion, '--warn-all',
scan_command += ['--no-libtool', '--namespace=' + ns, '--nsversion=' + nsversion, '--warn-all',
'--output', '@OUTPUT@']
extra_args = mesonlib.stringlistify(kwargs.pop('extra_args', []))

@ -87,7 +87,7 @@ class Lexer:
mo = reg.match(code, loc)
if mo:
curline = lineno
col = mo.start()-line_start
col = mo.start() - line_start
matched = True
span_start = loc
loc = mo.end()

@ -29,25 +29,25 @@ class DataSizes():
p = '<'
else:
p = '>'
self.Half = p+'h'
self.Half = p + 'h'
self.HalfSize = 2
self.Word = p+'I'
self.Word = p + 'I'
self.WordSize = 4
self.Sword = p+'i'
self.Sword = p + 'i'
self.SwordSize = 4
if ptrsize == 64:
self.Addr = p+'Q'
self.Addr = p + 'Q'
self.AddrSize = 8
self.Off = p+'Q'
self.Off = p + 'Q'
self.OffSize = 8
self.XWord = p+'Q'
self.XWord = p + 'Q'
self.XWordSize = 8
self.Sxword = p+'q'
self.Sxword = p + 'q'
self.SxwordSize = 8
else:
self.Addr = p+'I'
self.Addr = p + 'I'
self.AddrSize = 4
self.Off = p+'I'
self.Off = p + 'I'
self.OffSize = 4
class DynamicEntry(DataSizes):
@ -273,7 +273,7 @@ class Elf(DataSizes):
name = self.read_str()
if name.startswith(prefix):
basename = name.split(b'/')[-1]
padding = b'\0'*(len(name) - len(basename))
padding = b'\0' * (len(name) - len(basename))
newname = basename + padding
assert(len(newname) == len(name))
self.bf.seek(offset)
@ -299,7 +299,7 @@ class Elf(DataSizes):
sys.exit("New rpath must not be longer than the old one.")
self.bf.seek(rp_off)
self.bf.write(new_rpath)
self.bf.write(b'\0'*(len(old_rpath) - len(new_rpath) + 1))
self.bf.write(b'\0' * (len(old_rpath) - len(new_rpath) + 1))
if len(new_rpath) == 0:
self.remove_rpath_entry(entrynum)
@ -311,7 +311,7 @@ class Elf(DataSizes):
if entry.d_tag == entrynum:
rpentry = self.dynamic[i]
rpentry.d_tag = 0
self.dynamic = self.dynamic[:i] + self.dynamic[i+1:] + [rpentry]
self.dynamic = self.dynamic[:i] + self.dynamic[i + 1:] + [rpentry]
break;
# DT_MIPS_RLD_MAP_REL is relative to the offset of the tag. Adjust it consequently.
for entry in self.dynamic[i:]:

@ -51,7 +51,7 @@ def do_copydir(src_prefix, src_dir, dst_dir):
for root, dirs, files in os.walk(src_prefix):
for d in dirs:
abs_src = os.path.join(src_dir, root, d)
filepart = abs_src[len(src_dir)+1:]
filepart = abs_src[len(src_dir) + 1:]
abs_dst = os.path.join(dst_dir, filepart)
if os.path.isdir(abs_dst):
continue
@ -62,7 +62,7 @@ def do_copydir(src_prefix, src_dir, dst_dir):
shutil.copystat(abs_src, abs_dst)
for f in files:
abs_src = os.path.join(src_dir, root, f)
filepart = abs_src[len(src_dir)+1:]
filepart = abs_src[len(src_dir) + 1:]
abs_dst = os.path.join(dst_dir, filepart)
if os.path.isdir(abs_dst):
print('Tried to copy file %s but a directory of that name already exists.' % abs_dst)

@ -80,7 +80,7 @@ def osx_syms(libfilename, outfilename):
if 'LC_ID_DYLIB' in val:
match = i
break
result = [arr[match+2], arr[match+5]] # Libreoffice stores all 5 lines but the others seem irrelevant.
result = [arr[match + 2], arr[match + 5]] # Libreoffice stores all 5 lines but the others seem irrelevant.
pnm, output = Popen_safe(['nm', '-g', '-P', libfilename])[0:2]
if pnm.returncode != 0:
raise RuntimeError('nm does not work.')

@ -33,7 +33,7 @@ def build_pot(srcdir, project_id, sources):
# Must be relative paths
sources = [os.path.join('C', source) for source in sources]
outfile = os.path.join(srcdir, project_id + '.pot')
subprocess.call(['itstool', '-o', outfile]+sources)
subprocess.call(['itstool', '-o', outfile] + sources)
def update_po(srcdir, project_id, langs):
potfile = os.path.join(srcdir, project_id + '.pot')
@ -55,7 +55,7 @@ def merge_translations(blddir, sources, langs):
subprocess.call([
'itstool', '-m', os.path.join(blddir, lang, lang + '.gmo'),
'-o', os.path.join(blddir, lang)
]+sources)
] + sources)
def install_help(srcdir, blddir, sources, media, langs, install_dir, destdir, project_id, symlinks):
c_install_dir = os.path.join(install_dir, 'C', project_id)

@ -181,7 +181,7 @@ class Resolver:
cwd=checkoutdir)
def get_data(self, url):
blocksize = 10*1024
blocksize = 10 * 1024
if url.startswith('https://wrapdb.mesonbuild.com'):
resp = open_wrapdburl(url)
else:
@ -206,7 +206,7 @@ class Resolver:
break
downloaded += len(block)
blocks.append(block)
ratio = int(downloaded/dlsize * 10)
ratio = int(downloaded / dlsize * 10)
while printed_dots < ratio:
print('.', end='')
sys.stdout.flush()

@ -274,10 +274,10 @@ class TestHarness:
return result
def print_stats(self, numlen, tests, name, result, i, logfile, jsonlogfile):
startpad = ' '*(numlen - len('%d' % (i+1)))
num = '%s%d/%d' % (startpad, i+1, len(tests))
padding1 = ' '*(38-len(name))
padding2 = ' '*(8-len(result.res))
startpad = ' ' * (numlen - len('%d' % (i + 1)))
num = '%s%d/%d' % (startpad, i + 1, len(tests))
padding1 = ' ' * (38 - len(name))
padding2 = ' ' * (8 - len(result.res))
result_str = '%s %s %s%s%s%5.2f s' % \
(num, name, padding1, result.res, padding2, result.duration)
print(result_str)
@ -425,7 +425,7 @@ class TestHarness:
for t in tests:
if t.name in self.options.args:
for i in range(self.options.repeat):
print('Running: %s %d/%d' % (t.name, i+1, self.options.repeat))
print('Running: %s %d/%d' % (t.name, i + 1, self.options.repeat))
if self.options.gdb:
wrap = ['gdb', '--quiet']
if len(t.cmd_args) > 0:

@ -59,7 +59,7 @@ class AutoDeletedDir():
shutil.rmtree(self.dir)
return
except OSError:
if i == retries-1:
if i == retries - 1:
raise
time.sleep(0.1 * (2**i))
@ -472,7 +472,7 @@ def check_format():
def pbcompile(compiler, source, objectfile):
if compiler == 'cl':
cmd = [compiler, '/nologo', '/Fo'+objectfile, '/c', source]
cmd = [compiler, '/nologo', '/Fo' + objectfile, '/c', source]
else:
cmd = [compiler, '-c', source, '-o', objectfile]
subprocess.check_call(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)

@ -12,7 +12,7 @@ if __name__ == '__main__':
ifile = sys.argv[2]
ofile = sys.argv[3]
if compiler.endswith('cl'):
cmd = [compiler, '/nologo', '/MDd', '/Fo'+ofile, '/c', ifile]
cmd = [compiler, '/nologo', '/MDd', '/Fo' + ofile, '/c', ifile]
else:
cmd = [compiler, '-c', ifile, '-o', ofile]
sys.exit(subprocess.call(cmd))

@ -12,7 +12,7 @@ if __name__ == '__main__':
ifile = sys.argv[2]
ofile = sys.argv[3]
if compiler.endswith('cl'):
cmd = [compiler, '/nologo', '/MDd', '/Fo'+ofile, '/c', ifile]
cmd = [compiler, '/nologo', '/MDd', '/Fo' + ofile, '/c', ifile]
else:
cmd = [compiler, '-c', ifile, '-o', ofile]
sys.exit(subprocess.call(cmd))

@ -53,7 +53,7 @@ class Lexer:
for (tid, reg) in self.token_specification:
mo = reg.match(code, loc)
if mo:
col = mo.start()-line_start
col = mo.start() - line_start
matched = True
loc = mo.end()
match_text = mo.group()
@ -240,7 +240,7 @@ class Converter:
else:
line = '''# %s(%s)''' % (t.name, self.convert_args(t.args))
self.indent_level += preincrement
indent = self.indent_level*self.indent_unit
indent = self.indent_level * self.indent_unit
outfile.write(indent)
outfile.write(line)
if not(line.endswith('\n')):

Loading…
Cancel
Save