summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2022-09-18 09:04:41 +0200
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2022-09-19 16:14:13 +0200
commit056d8e5fab7a167f73115d524ab92170b3ed5f9f (patch)
tree662c8a9d8da2071ee8a7b96a8603cc2fa9f1078d
parent8d6d31bb8f9b44c6147522c49fa099c110b067f0 (diff)
downloadastroid-git-056d8e5fab7a167f73115d524ab92170b3ed5f9f.tar.gz
[flake8] Set the max complexity to the default instead of 83
-rw-r--r--astroid/arguments.py2
-rw-r--r--astroid/bases.py2
-rw-r--r--astroid/brain/brain_gi.py2
-rw-r--r--astroid/decorators.py2
-rw-r--r--astroid/manager.py2
-rw-r--r--astroid/nodes/scoped_nodes/scoped_nodes.py2
-rw-r--r--astroid/objects.py4
-rw-r--r--astroid/protocols.py3
-rw-r--r--astroid/rebuilder.py2
-rw-r--r--setup.cfg5
10 files changed, 12 insertions, 14 deletions
diff --git a/astroid/arguments.py b/astroid/arguments.py
index fdbe7aac..4108c0dd 100644
--- a/astroid/arguments.py
+++ b/astroid/arguments.py
@@ -150,7 +150,7 @@ class CallSite:
values.append(arg)
return values
- def infer_argument(self, funcnode, name, context):
+ def infer_argument(self, funcnode, name, context): # noqa: C901
"""infer a function argument value according to the call context
Arguments:
diff --git a/astroid/bases.py b/astroid/bases.py
index 1f5072a8..25a8393d 100644
--- a/astroid/bases.py
+++ b/astroid/bases.py
@@ -485,7 +485,7 @@ class BoundMethod(UnboundMethod):
def is_bound(self):
return True
- def _infer_type_new_call(self, caller, context):
+ def _infer_type_new_call(self, caller, context): # noqa: C901
"""Try to infer what type.__new__(mcs, name, bases, attrs) returns.
In order for such call to be valid, the metaclass needs to be
diff --git a/astroid/brain/brain_gi.py b/astroid/brain/brain_gi.py
index 53491d14..248a6016 100644
--- a/astroid/brain/brain_gi.py
+++ b/astroid/brain/brain_gi.py
@@ -54,7 +54,7 @@ _special_methods = frozenset(
)
-def _gi_build_stub(parent):
+def _gi_build_stub(parent): # noqa: C901
"""
Inspect the passed module recursively and build stubs for functions,
classes, etc.
diff --git a/astroid/decorators.py b/astroid/decorators.py
index abdc1270..9def52cd 100644
--- a/astroid/decorators.py
+++ b/astroid/decorators.py
@@ -157,7 +157,7 @@ def raise_if_nothing_inferred(func, instance, args, kwargs):
# Expensive decorators only used to emit Deprecation warnings.
# If no other than the default DeprecationWarning are enabled,
# fall back to passthrough implementations.
-if util.check_warnings_filter():
+if util.check_warnings_filter(): # noqa: C901
def deprecate_default_argument_values(
astroid_version: str = "3.0", **arguments: str
diff --git a/astroid/manager.py b/astroid/manager.py
index f0932d54..737fcda3 100644
--- a/astroid/manager.py
+++ b/astroid/manager.py
@@ -148,7 +148,7 @@ class AstroidManager:
modname, self.extension_package_whitelist
)
- def ast_from_module_name(
+ def ast_from_module_name( # noqa: C901
self,
modname: str | None,
context_file: str | None = None,
diff --git a/astroid/nodes/scoped_nodes/scoped_nodes.py b/astroid/nodes/scoped_nodes/scoped_nodes.py
index b01c23f3..833da66c 100644
--- a/astroid/nodes/scoped_nodes/scoped_nodes.py
+++ b/astroid/nodes/scoped_nodes/scoped_nodes.py
@@ -1475,7 +1475,7 @@ class FunctionDef(_base_nodes.MultiLineBlockNode, _base_nodes.Statement, Lambda)
return decorators
@cached_property
- def type(self) -> str: # pylint: disable=too-many-return-statements
+ def type(self) -> str: # pylint: disable=too-many-return-statements # noqa: C901
"""The function type for this node.
Possible values are: method, function, staticmethod, classmethod.
diff --git a/astroid/objects.py b/astroid/objects.py
index 1649674f..a1d886bb 100644
--- a/astroid/objects.py
+++ b/astroid/objects.py
@@ -138,7 +138,9 @@ class Super(node_classes.NodeNG):
def qname(self) -> Literal["super"]:
return "super"
- def igetattr(self, name: str, context: InferenceContext | None = None):
+ def igetattr( # noqa: C901
+ self, name: str, context: InferenceContext | None = None
+ ):
"""Retrieve the inferred values of the given attribute name."""
# '__class__' is a special attribute that should be taken directly
# from the special attributes dict
diff --git a/astroid/protocols.py b/astroid/protocols.py
index 0d90d90b..1b2bf73d 100644
--- a/astroid/protocols.py
+++ b/astroid/protocols.py
@@ -672,7 +672,7 @@ nodes.NamedExpr.assigned_stmts = named_expr_assigned_stmts
@decorators.yes_if_nothing_inferred
-def starred_assigned_stmts(
+def starred_assigned_stmts( # noqa: C901
self: nodes.Starred,
node: node_classes.AssignedStmtsPossibleNode = None,
context: InferenceContext | None = None,
@@ -823,7 +823,6 @@ def starred_assigned_stmts(
last_lookup = lookup_slice
for element in itered:
-
# We probably want to infer the potential values *for each* element in an
# iterable, but we can't infer a list of all values, when only a list of
# step values are expected:
diff --git a/astroid/rebuilder.py b/astroid/rebuilder.py
index 757feaa4..2c868fd0 100644
--- a/astroid/rebuilder.py
+++ b/astroid/rebuilder.py
@@ -259,7 +259,7 @@ class TreeRebuilder:
self._reset_end_lineno(newnode)
return newnode
- if TYPE_CHECKING:
+ if TYPE_CHECKING: # noqa: C901
@overload
def visit(self, node: ast.arg, parent: NodeNG) -> nodes.AssignName:
diff --git a/setup.cfg b/setup.cfg
index 74d9078e..c6be9f8f 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -14,10 +14,7 @@ extend-ignore =
E203, # Incompatible with black see https://github.com/psf/black/issues/315
W503, # Incompatible with black
B901 # Combine yield and return statements in one function
-max-complexity = 83
-max-line-length = 120
-# per-file-ignores =
-# astroid/brain/brain_numpy_core_multiarray.py: E501, B950
+max-line-length = 110
select = B,C,E,F,W,T4,B9
# Required for flake8-typing-imports (v1.12.0)
# The plugin doesn't yet read the value from pyproject.toml