aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2023-02-01 15:57:35 -0500
committerNirbheek Chauhan <nirbheek@centricular.com>2023-02-06 23:42:44 +0530
commitdba6cc2dd02a213026bee255837ffc3033ab1cc5 (patch)
tree563561a9f7ffded08f052514c9ae909b0e445168
parente1b98a89b566cc983b43c12fabc050c707d9e36b (diff)
downloadmeson-dba6cc2dd02a213026bee255837ffc3033ab1cc5.zip
meson-dba6cc2dd02a213026bee255837ffc3033ab1cc5.tar.gz
meson-dba6cc2dd02a213026bee255837ffc3033ab1cc5.tar.bz2
pylint 2.16: remove pointless parens around equality assignments
Given the construct `foo = (bar == baz)` some people like parentheses and some do not. They're pointless and don't mean anything, though. I don't feel this is particularly helpful to code clarity, tbh, and pylint now notices this and warns about it in our current pylint config. I think this is reasonable, so let's remove the odd parens.
-rw-r--r--mesonbuild/backend/ninjabackend.py2
-rw-r--r--mesonbuild/mtest.py2
-rw-r--r--mesonbuild/scripts/vcstagger.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 0ce7f43..5722cbb 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -2669,7 +2669,7 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485'''))
is_generated: bool = False) -> 'ImmutableListProtocol[str]':
# The code generated by valac is usually crap and has tons of unused
# variables and such, so disable warnings for Vala C sources.
- no_warn_args = (is_generated == 'vala')
+ no_warn_args = is_generated == 'vala'
# Add compiler args and include paths from several sources; defaults,
# build options, external dependencies, etc.
commands = self.generate_basic_compiler_args(target, compiler, no_warn_args)
diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py
index eab28ed..124da87 100644
--- a/mesonbuild/mtest.py
+++ b/mesonbuild/mtest.py
@@ -411,7 +411,7 @@ class TAPParser:
yield self.Error('more than one plan found')
else:
num_tests = int(m.group(1))
- skipped = (num_tests == 0)
+ skipped = num_tests == 0
if m.group(2):
if m.group(2).upper().startswith('SKIP'):
if num_tests > 0:
diff --git a/mesonbuild/scripts/vcstagger.py b/mesonbuild/scripts/vcstagger.py
index 051a970..c484ee1 100644
--- a/mesonbuild/scripts/vcstagger.py
+++ b/mesonbuild/scripts/vcstagger.py
@@ -27,7 +27,7 @@ def config_vcs_tag(infile: str, outfile: str, fallback: str, source_dir: str, re
new_data = f.read().replace(replace_string, new_string)
if os.path.exists(outfile):
with open(outfile, encoding='utf-8') as f:
- needs_update = (f.read() != new_data)
+ needs_update = f.read() != new_data
else:
needs_update = True
if needs_update: