pylint: turn on bad-indentation error

and fix all of the bad indentation
pull/7774/head
Dylan Baker 4 years ago
parent 3b292a04b8
commit f342efd080
  1. 1
      .pylintrc
  2. 8
      mesonbuild/build.py
  3. 2
      mesonbuild/coredata.py
  4. 2
      mesonbuild/mesonlib.py
  5. 46
      mesonbuild/modules/qt.py
  6. 2
      mesonbuild/optinterpreter.py

@ -9,6 +9,7 @@ disable=all
enable= enable=
abstract-class-instantiated, abstract-class-instantiated,
assert-on-tuple, assert-on-tuple,
bad-indentation,
compare-to-zero, compare-to-zero,
dangerous-default-value, dangerous-default-value,
deprecated-lambda, deprecated-lambda,

@ -462,10 +462,10 @@ a hard error in the future.'''.format(name))
for k, v in option_overrides.items(): for k, v in option_overrides.items():
if '_' in k: if '_' in k:
lang, k2 = k.split('_', 1) lang, k2 = k.split('_', 1)
if lang in all_languages: if lang in all_languages:
self.option_overrides_compiler[lang][k2] = v self.option_overrides_compiler[lang][k2] = v
continue continue
self.option_overrides_base[k] = v self.option_overrides_base[k] = v
def parse_overrides(self, kwargs) -> dict: def parse_overrides(self, kwargs) -> dict:

@ -771,7 +771,7 @@ class CoreData:
lang, key = k.split('_', 1) lang, key = k.split('_', 1)
for machine in MachineChoice: for machine in MachineChoice:
if key not in env.compiler_options[machine][lang]: if key not in env.compiler_options[machine][lang]:
env.compiler_options[machine][lang][key] = v env.compiler_options[machine][lang][key] = v
elif k in base_options: elif k in base_options:
if not subproject and k not in env.base_options: if not subproject and k not in env.base_options:
env.base_options[k] = v env.base_options[k] = v

@ -946,7 +946,7 @@ def do_define(regex: T.Pattern[str], line: str, confdata: 'ConfigurationData', v
arr = line.split() arr = line.split()
if variable_format == 'meson' and len(arr) != 2: if variable_format == 'meson' and len(arr) != 2:
raise MesonException('#mesondefine does not contain exactly two tokens: %s' % line.strip()) raise MesonException('#mesondefine does not contain exactly two tokens: %s' % line.strip())
varname = arr[1] varname = arr[1]
try: try:

@ -87,29 +87,29 @@ class QtBaseModule(ExtensionModule):
rcc_dirname, nodes = self.qrc_nodes(state, rcc_file) rcc_dirname, nodes = self.qrc_nodes(state, rcc_file)
result = [] result = []
for resource_path in nodes: for resource_path in nodes:
# We need to guess if the pointed resource is: # We need to guess if the pointed resource is:
# a) in build directory -> implies a generated file # a) in build directory -> implies a generated file
# b) in source directory # b) in source directory
# c) somewhere else external dependency file to bundle # c) somewhere else external dependency file to bundle
# #
# Also from qrc documentation: relative path are always from qrc file # Also from qrc documentation: relative path are always from qrc file
# So relative path must always be computed from qrc file ! # So relative path must always be computed from qrc file !
if os.path.isabs(resource_path): if os.path.isabs(resource_path):
# a) # a)
if resource_path.startswith(os.path.abspath(state.environment.build_dir)): if resource_path.startswith(os.path.abspath(state.environment.build_dir)):
resource_relpath = os.path.relpath(resource_path, state.environment.build_dir) resource_relpath = os.path.relpath(resource_path, state.environment.build_dir)
result.append(File(is_built=True, subdir='', fname=resource_relpath)) result.append(File(is_built=True, subdir='', fname=resource_relpath))
# either b) or c) # either b) or c)
else: else:
result.append(File(is_built=False, subdir=state.subdir, fname=resource_path)) result.append(File(is_built=False, subdir=state.subdir, fname=resource_path))
else: else:
path_from_rcc = os.path.normpath(os.path.join(rcc_dirname, resource_path)) path_from_rcc = os.path.normpath(os.path.join(rcc_dirname, resource_path))
# a) # a)
if path_from_rcc.startswith(state.environment.build_dir): if path_from_rcc.startswith(state.environment.build_dir):
result.append(File(is_built=True, subdir=state.subdir, fname=resource_path)) result.append(File(is_built=True, subdir=state.subdir, fname=resource_path))
# b) # b)
else: else:
result.append(File(is_built=False, subdir=state.subdir, fname=path_from_rcc)) result.append(File(is_built=False, subdir=state.subdir, fname=path_from_rcc))
return result return result
@noPosargs @noPosargs

@ -210,7 +210,7 @@ class OptionInterpreter:
(posargs, kwargs) = self.reduce_arguments(node.args) (posargs, kwargs) = self.reduce_arguments(node.args)
if 'yield' in kwargs: if 'yield' in kwargs:
FeatureNew.single_use('option yield', '0.45.0', self.subproject) FeatureNew.single_use('option yield', '0.45.0', self.subproject)
if 'type' not in kwargs: if 'type' not in kwargs:
raise OptionException('Option call missing mandatory "type" keyword argument') raise OptionException('Option call missing mandatory "type" keyword argument')

Loading…
Cancel
Save