Browse Source

pylint: turn on bad-indentation error

and fix all of the bad indentation
tags/0.56.0.rc1
Dylan Baker 1 month ago
parent
commit
f342efd080
6 changed files with 31 additions and 30 deletions
  1. +1
    -0
      .pylintrc
  2. +4
    -4
      mesonbuild/build.py
  3. +1
    -1
      mesonbuild/coredata.py
  4. +1
    -1
      mesonbuild/mesonlib.py
  5. +23
    -23
      mesonbuild/modules/qt.py
  6. +1
    -1
      mesonbuild/optinterpreter.py

+ 1
- 0
.pylintrc View File

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


+ 4
- 4
mesonbuild/build.py View File

@@ -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:


+ 1
- 1
mesonbuild/coredata.py View File

@@ -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


+ 1
- 1
mesonbuild/mesonlib.py View File

@@ -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:


+ 23
- 23
mesonbuild/modules/qt.py View File

@@ -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


+ 1
- 1
mesonbuild/optinterpreter.py View File

@@ -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')


Loading…
Cancel
Save