pylint: enable unnecessary-comprehension

pull/10889/head
Dylan Baker 3 years ago committed by Eli Schwartz
parent 676e66f853
commit 20d76b8353
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 1
      .pylintrc
  2. 4
      mesonbuild/ast/interpreter.py
  3. 3
      mesonbuild/ast/printer.py
  4. 2
      mesonbuild/cmake/interpreter.py
  5. 3
      mesonbuild/modules/pkgconfig.py
  6. 4
      mesonbuild/modules/rust.py

@ -70,7 +70,6 @@ disable=
typevar-name-incorrect-variance, typevar-name-incorrect-variance,
undefined-loop-variable, undefined-loop-variable,
unidiomatic-typecheck, unidiomatic-typecheck,
unnecessary-comprehension,
unnecessary-dict-index-lookup, unnecessary-dict-index-lookup,
unnecessary-lambda, unnecessary-lambda,
unnecessary-lambda-assignment, unnecessary-lambda-assignment,

@ -365,10 +365,10 @@ class AstInterpreter(InterpreterBase):
result = not result result = not result
elif isinstance(node, ArrayNode): elif isinstance(node, ArrayNode):
result = [x for x in node.args.arguments] result = node.args.arguments.copy()
elif isinstance(node, ArgumentNode): elif isinstance(node, ArgumentNode):
result = [x for x in node.arguments] result = node.arguments.copy()
elif isinstance(node, ArithmeticNode): elif isinstance(node, ArithmeticNode):
if node.operation != 'add': if node.operation != 'add':

@ -173,9 +173,8 @@ class AstPrinter(AstVisitor):
def visit_ForeachClauseNode(self, node: mparser.ForeachClauseNode) -> None: def visit_ForeachClauseNode(self, node: mparser.ForeachClauseNode) -> None:
node.lineno = self.curr_line or node.lineno node.lineno = self.curr_line or node.lineno
varnames = [x for x in node.varnames]
self.append_padded('foreach', node) self.append_padded('foreach', node)
self.append_padded(', '.join(varnames), node) self.append_padded(', '.join(node.varnames), node)
self.append_padded(':', node) self.append_padded(':', node)
node.items.accept(self) node.items.accept(self)
self.newline() self.newline()

@ -519,7 +519,7 @@ class ConverterTarget:
def _all_source_suffixes(self) -> 'ImmutableListProtocol[str]': def _all_source_suffixes(self) -> 'ImmutableListProtocol[str]':
suffixes = [] # type: T.List[str] suffixes = [] # type: T.List[str]
for exts in lang_suffixes.values(): for exts in lang_suffixes.values():
suffixes += [x for x in exts] suffixes.extend(exts)
return suffixes return suffixes
@lru_cache(maxsize=None) @lru_cache(maxsize=None)

@ -271,8 +271,7 @@ class DependenciesHelper:
# Note that pkg-config is picky about whitespace. # Note that pkg-config is picky about whitespace.
# 'foo > 1.2' is ok but 'foo>1.2' is not. # 'foo > 1.2' is ok but 'foo>1.2' is not.
# foo, bar' is ok, but 'foo,bar' is not. # foo, bar' is ok, but 'foo,bar' is not.
new_vreqs = [s for s in mesonlib.stringlistify(version_reqs)] self.version_reqs[name].update(version_reqs)
self.version_reqs[name].update(new_vreqs)
def split_version_req(self, s: str) -> T.Tuple[str, T.Optional[str]]: def split_version_req(self, s: str) -> T.Tuple[str, T.Optional[str]]:
for op in ['>=', '<=', '!=', '==', '=', '>', '<']: for op in ['>=', '<=', '!=', '==', '=', '>', '<']:

@ -134,8 +134,6 @@ class RustModule(ExtensionModule):
del extra_args[i] del extra_args[i]
break break
dependencies = [d for d in kwargs['dependencies']]
# We need to cast here, as currently these don't have protocol in them, but test itself does. # We need to cast here, as currently these don't have protocol in them, but test itself does.
tkwargs = T.cast('_kwargs.FuncTest', kwargs.copy()) tkwargs = T.cast('_kwargs.FuncTest', kwargs.copy())
@ -147,7 +145,7 @@ class RustModule(ExtensionModule):
# one # one
new_target_kwargs['rust_args'] = new_target_kwargs.get('rust_args', []) + ['--test'] new_target_kwargs['rust_args'] = new_target_kwargs.get('rust_args', []) + ['--test']
new_target_kwargs['install'] = False new_target_kwargs['install'] = False
new_target_kwargs['dependencies'] = new_target_kwargs.get('dependencies', []) + dependencies new_target_kwargs['dependencies'] = new_target_kwargs.get('dependencies', []) + kwargs['dependencies']
new_target = Executable( new_target = Executable(
name, base_target.subdir, state.subproject, base_target.for_machine, name, base_target.subdir, state.subproject, base_target.for_machine,

Loading…
Cancel
Save