pylint: turn on bad-indentation error

and fix all of the bad indentation
pull/7774/head
Dylan Baker 4 jaren geleden
bovenliggende 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=
abstract-class-instantiated,
assert-on-tuple,
bad-indentation,
compare-to-zero,
dangerous-default-value,
deprecated-lambda,

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

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

@ -946,7 +946,7 @@ def do_define(regex: T.Pattern[str], line: str, confdata: 'ConfigurationData', v
arr = line.split()
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]
try:

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

@ -210,7 +210,7 @@ class OptionInterpreter:
(posargs, kwargs) = self.reduce_arguments(node.args)
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:
raise OptionException('Option call missing mandatory "type" keyword argument')

Laden…
Annuleren
Opslaan