aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2020-09-22 09:43:48 -0700
committerDylan Baker <dylan@pnwbakers.com>2020-09-22 17:57:03 -0700
commitf342efd080678a4c8db1c1e25296923176e821f6 (patch)
treee381f1ad2611e2b83c6acfc130d901e104371354
parent3b292a04b8797bb75f1f597dadb17d8342f9fb11 (diff)
downloadmeson-f342efd080678a4c8db1c1e25296923176e821f6.zip
meson-f342efd080678a4c8db1c1e25296923176e821f6.tar.gz
meson-f342efd080678a4c8db1c1e25296923176e821f6.tar.bz2
pylint: turn on bad-indentation error
and fix all of the bad indentation
-rw-r--r--.pylintrc1
-rw-r--r--mesonbuild/build.py8
-rw-r--r--mesonbuild/coredata.py2
-rw-r--r--mesonbuild/mesonlib.py2
-rw-r--r--mesonbuild/modules/qt.py46
-rw-r--r--mesonbuild/optinterpreter.py2
6 files changed, 31 insertions, 30 deletions
diff --git a/.pylintrc b/.pylintrc
index e9908ba..2ff8c56 100644
--- a/.pylintrc
+++ b/.pylintrc
@@ -9,6 +9,7 @@ disable=all
enable=
abstract-class-instantiated,
assert-on-tuple,
+ bad-indentation,
compare-to-zero,
dangerous-default-value,
deprecated-lambda,
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 30fa77a..be97634 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -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:
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
index bba3942..a36bbe9 100644
--- a/mesonbuild/coredata.py
+++ b/mesonbuild/coredata.py
@@ -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
diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py
index c6cbbd6..dd2fe8e 100644
--- a/mesonbuild/mesonlib.py
+++ b/mesonbuild/mesonlib.py
@@ -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:
diff --git a/mesonbuild/modules/qt.py b/mesonbuild/modules/qt.py
index c7a1c46..32ff6af 100644
--- a/mesonbuild/modules/qt.py
+++ b/mesonbuild/modules/qt.py
@@ -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
diff --git a/mesonbuild/optinterpreter.py b/mesonbuild/optinterpreter.py
index 75011e7..ec329a8 100644
--- a/mesonbuild/optinterpreter.py
+++ b/mesonbuild/optinterpreter.py
@@ -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')