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/cmake/fileapi.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'mesonbuild/cmake/fileapi.py') diff --git a/mesonbuild/cmake/fileapi.py b/mesonbuild/cmake/fileapi.py index 5d4d01a..710e4ed 100644 --- a/mesonbuild/cmake/fileapi.py +++ b/mesonbuild/cmake/fileapi.py @@ -80,15 +80,15 @@ class CMakeFileAPI: # parse the JSON for i in index['objects']: - assert(isinstance(i, dict)) - assert('kind' in i) - assert(i['kind'] in self.kind_resolver_map) + assert isinstance(i, dict) + assert 'kind' in i + assert i['kind'] in self.kind_resolver_map self.kind_resolver_map[i['kind']](i) def _parse_codemodel(self, data: T.Dict[str, T.Any]) -> None: - assert('configurations' in data) - assert('paths' in data) + assert 'configurations' in data + assert 'paths' in data source_dir = data['paths']['source'] build_dir = data['paths']['build'] -- cgit v1.1