aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/build.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-08-31 09:55:01 -0700
committerEli Schwartz <eschwartz93@gmail.com>2021-08-31 16:28:54 -0400
commit4d7031437c7a81b52c776d4ae1e32741bdb851ca (patch)
tree7716c4af0d3f43b450a7c94dd42ae5dbef8ebdff /mesonbuild/build.py
parent06fdb29daace9ebe55e5df5336f65cba304773d2 (diff)
downloadmeson-4d7031437c7a81b52c776d4ae1e32741bdb851ca.zip
meson-4d7031437c7a81b52c776d4ae1e32741bdb851ca.tar.gz
meson-4d7031437c7a81b52c776d4ae1e32741bdb851ca.tar.bz2
pylint: turn on superflous-parens
We have a lot of these. Some of them are harmless, if unidiomatic, such as `if (condition)`, others are potentially dangerous `assert(...)`, as `assert(condtion)` works as expected, but `assert(condition, message)` will result in an assertion that never triggers, as what you're actually asserting is `bool(tuple[2])`, which will always be true.
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r--mesonbuild/build.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index bc4065b..c6a6994 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -695,7 +695,7 @@ class BuildTarget(Target):
mlog.warning('Unknown keyword argument(s) in target {}: {}.'.format(self.name, ', '.join(unknowns)))
def process_objectlist(self, objects):
- assert(isinstance(objects, list))
+ assert isinstance(objects, list)
for s in objects:
if isinstance(s, (str, File, ExtractedObjects)):
self.objects.append(s)
@@ -850,7 +850,7 @@ class BuildTarget(Target):
m += '\n'.join([repr(c) for c in check_sources])
raise InvalidArguments(m)
# CSharp and Java targets can't contain any other file types
- assert(len(self.compilers) == 1)
+ assert len(self.compilers) == 1
return
def process_link_depends(self, sources, environment):
@@ -1054,9 +1054,9 @@ class BuildTarget(Target):
raise InvalidArguments('Argument win_subsystem can only be used on executables.')
extra_files = extract_as_list(kwargs, 'extra_files')
for i in extra_files:
- assert(isinstance(i, File))
+ assert isinstance(i, File)
trial = os.path.join(environment.get_source_dir(), i.subdir, i.fname)
- if not(os.path.isfile(trial)):
+ if not os.path.isfile(trial):
raise InvalidArguments(f'Tried to add non-existing extra file {i}.')
self.extra_files = extra_files
self.install_rpath: str = kwargs.get('install_rpath', '')
@@ -1324,7 +1324,7 @@ You probably should put it in link_with instead.''')
else:
raise InvalidArguments(f'PCH argument {pchlist[0]} is of unknown type.')
- if (os.path.dirname(pchlist[0]) != os.path.dirname(pchlist[1])):
+ if os.path.dirname(pchlist[0]) != os.path.dirname(pchlist[1]):
raise InvalidArguments('PCH files must be stored in the same folder.')
mlog.warning('PCH source files are deprecated, only a single header file should be used.')
@@ -2296,7 +2296,7 @@ class CustomTarget(Target, CommandBase):
inputs = get_sources_string_names(self.sources, backend)
values = get_filenames_templates_dict(inputs, [])
for i in self.outputs:
- if not(isinstance(i, str)):
+ if not isinstance(i, str):
raise InvalidArguments('Output argument not a string.')
if i == '':
raise InvalidArguments('Output must not be empty.')