From 4d7031437c7a81b52c776d4ae1e32741bdb851ca Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 31 Aug 2021 09:55:01 -0700 Subject: 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. --- mesonbuild/compilers/cpp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mesonbuild/compilers/cpp.py') diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py index 1e46f26d1..168ba7a40 100644 --- a/mesonbuild/compilers/cpp.py +++ b/mesonbuild/compilers/cpp.py @@ -119,7 +119,7 @@ class CPPCompiler(CLikeCompiler, Compiler): def _test_cpp_std_arg(self, cpp_std_value: str) -> bool: # Test whether the compiler understands a -std=XY argument - assert(cpp_std_value.startswith('-std=')) + assert cpp_std_value.startswith('-std=') # This test does not use has_multi_arguments() for two reasons: # 1. has_multi_arguments() requires an env argument, which the compiler @@ -155,7 +155,7 @@ class CPPCompiler(CLikeCompiler, Compiler): } # Currently, remapping is only supported for Clang, Elbrus and GCC - assert(self.id in frozenset(['clang', 'lcc', 'gcc', 'emscripten'])) + assert self.id in frozenset(['clang', 'lcc', 'gcc', 'emscripten']) if cpp_std not in CPP_FALLBACKS: # 'c++03' and 'c++98' don't have fallback types -- cgit v1.2.3