Skip to content

Commit

Permalink
Update pylint to 2.14.0b1 (pylint-dev#1553)
Browse files Browse the repository at this point in the history
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
  • Loading branch information
cdce8p and Pierre-Sassoulas authored May 12, 2022
1 parent 5e1a1b7 commit 58bbe0f
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 60 deletions.
2 changes: 1 addition & 1 deletion astroid/arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def infer_argument(self, funcnode, name, context):
"""
if name in self.duplicated_keywords:
raise InferenceError(
"The arguments passed to {func!r} " " have duplicate keywords.",
"The arguments passed to {func!r} have duplicate keywords.",
call_site=self,
func=funcnode,
arg=name,
Expand Down
1 change: 0 additions & 1 deletion astroid/brain/brain_gi.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"__nonzero__",
"__next__",
"__str__",
"__len__",
"__contains__",
"__enter__",
"__exit__",
Expand Down
1 change: 0 additions & 1 deletion astroid/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ class AstroidBuilder(raw_building.InspectBuilder):
by default being True.
"""

# pylint: disable=redefined-outer-name
def __init__(self, manager=None, apply_transforms=True):
super().__init__(manager)
self._apply_transforms = apply_transforms
Expand Down
2 changes: 1 addition & 1 deletion astroid/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def infer_ast_from_something(self, obj, context=None):
) from exc
except Exception as exc:
raise AstroidImportError(
"Unexpected error while retrieving name for {class_repr}:\n" "{error}",
"Unexpected error while retrieving name for {class_repr}:\n{error}",
cls=klass,
class_repr=safe_repr(klass),
) from exc
Expand Down
6 changes: 3 additions & 3 deletions astroid/protocols.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ def __enter__(self):
) from exc
except TypeError as exc:
raise InferenceError(
"Tried to unpack a non-iterable value " "in {node!r}.",
"Tried to unpack a non-iterable value in {node!r}.",
node=self,
targets=node,
assign_path=assign_path,
Expand Down Expand Up @@ -677,7 +677,7 @@ def _determine_starred_iteration_lookups(starred, target, lookups):
stmt = self.statement(future=True)
if not isinstance(stmt, (nodes.Assign, nodes.For)):
raise InferenceError(
"Statement {stmt!r} enclosing {node!r} " "must be an Assign or For node.",
"Statement {stmt!r} enclosing {node!r} must be an Assign or For node.",
node=self,
stmt=stmt,
unknown=node,
Expand All @@ -696,7 +696,7 @@ def _determine_starred_iteration_lookups(starred, target, lookups):

if sum(1 for _ in lhs.nodes_of_class(nodes.Starred)) > 1:
raise InferenceError(
"Too many starred arguments in the " " assignment targets {lhs!r}.",
"Too many starred arguments in the assignment targets {lhs!r}.",
node=self,
targets=lhs,
unknown=node,
Expand Down
2 changes: 0 additions & 2 deletions astroid/rebuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ def _get_position_info(
else:
return None

# pylint: disable=undefined-loop-variable
return Position(
lineno=node.lineno + start_token.start[0] - 1,
col_offset=start_token.start[1],
Expand Down Expand Up @@ -222,7 +221,6 @@ def _fix_doc_node_position(self, node: NodesWithDocsType) -> None:
else:
return

# pylint: disable=undefined-loop-variable
node.doc_node.lineno = lineno + t.start[0] - 1
node.doc_node.col_offset = t.start[1]
node.doc_node.end_lineno = lineno + t.end[0] - 1
Expand Down
45 changes: 0 additions & 45 deletions pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
# pygtk.require().
#init-hook=

# Profiled execution.
profile=no

# Add files or directories to the blacklist. They should be base names, not
# paths.
ignore=CVS
Expand Down Expand Up @@ -53,11 +50,6 @@ py-version = 3.6.2
# mypackage.mymodule.MyReporterClass.
output-format=text

# Put messages in a separate file for each module / package specified on the
# command line instead of printing them on stdout. Reports (if any) will be
# written in a file name "pylint_global.[txt|html]".
files-output=no

# Tells whether to display a full report or only the messages
reports=no

Expand Down Expand Up @@ -103,10 +95,6 @@ disable=fixme,
# Requires major redesign for fixing this (and private
# access in the same project is fine)
protected-access,
# Most of them are conforming to an API. Putting staticmethod
# all over the place changes the aesthetics when these methods
# are following a local pattern (visit methods for instance).
no-self-use,
# API requirements in most of the occurrences
unused-argument,
# black handles these
Expand Down Expand Up @@ -144,63 +132,33 @@ include-naming-hint=no
# Regular expression matching correct attribute names
attr-rgx=[a-z_][a-z0-9_]{2,30}$

# Naming hint for attribute names
attr-name-hint=[a-z_][a-z0-9_]{2,30}$

# Regular expression matching correct constant names
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$

# Naming hint for constant names
const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$

# Regular expression matching correct method names
method-rgx=[a-z_][a-z0-9_]{2,30}$

# Naming hint for method names
method-name-hint=[a-z_][a-z0-9_]{2,30}$

# Regular expression matching correct inline iteration names
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$

# Naming hint for inline iteration names
inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$

# Regular expression matching correct class names
class-rgx=[A-Z_][a-zA-Z0-9]+$

# Naming hint for class names
class-name-hint=[A-Z_][a-zA-Z0-9]+$

# Regular expression matching correct argument names
argument-rgx=[a-z_][a-z0-9_]{2,30}$

# Naming hint for argument names
argument-name-hint=[a-z_][a-z0-9_]{2,30}$

# Regular expression matching correct module names
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$

# Naming hint for module names
module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$

# Regular expression matching correct function names
function-rgx=[a-z_][a-z0-9_]{2,30}$

# Naming hint for function names
function-name-hint=[a-z_][a-z0-9_]{2,30}$

# Regular expression matching correct variable names
variable-rgx=[a-z_][a-z0-9_]{2,30}$

# Naming hint for variable names
variable-name-hint=[a-z_][a-z0-9_]{2,30}$

# Regular expression matching correct class attribute names
class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$

# Naming hint for class attribute names
class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$

# Regular expression which should only match function or class names that do

# not require a docstring.
Expand All @@ -223,9 +181,6 @@ ignore-long-lines=^\s*(# )?<?https?://\S+>?$
# else.
single-line-if-stmt=no

# List of optional constructs for which whitespace checking is disabled
no-space-check=trailing-comma,dict-separator

# Maximum number of lines in a module
max-module-lines=3000

Expand Down
2 changes: 1 addition & 1 deletion requirements_test_pre_commit.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
black==22.3.0
pylint~=2.13.8
pylint==2.14.0b1
isort==5.10.1
flake8==4.0.1
flake8-typing-imports==1.12.0
Expand Down
8 changes: 3 additions & 5 deletions tests/unittest_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -6632,7 +6632,7 @@ def test_imported_module_var_inferable(self) -> None:
"""
Module variables can be imported and inferred successfully as part of binary operators.
"""
mod1 = parse(("from top.mod import v as z\n" "w = [1] + z"), module_name="top")
mod1 = parse("from top.mod import v as z\nw = [1] + z", module_name="top")
parse("v = [2]", module_name="top.mod")
w_val = mod1.body[-1].value
i_w_val = next(w_val.infer())
Expand All @@ -6641,9 +6641,7 @@ def test_imported_module_var_inferable(self) -> None:

def test_imported_module_var_inferable2(self) -> None:
"""Version list of strings."""
mod1 = parse(
("from top.mod import v as z\n" "w = ['1'] + z"), module_name="top"
)
mod1 = parse("from top.mod import v as z\nw = ['1'] + z", module_name="top")
parse("v = ['2']", module_name="top.mod")
w_val = mod1.body[-1].value
i_w_val = next(w_val.infer())
Expand All @@ -6653,7 +6651,7 @@ def test_imported_module_var_inferable2(self) -> None:
def test_imported_module_var_inferable3(self) -> None:
"""Version list of strings with a __dunder__ name."""
mod1 = parse(
("from top.mod import __dunder_var__ as v\n" "__dunder_var__ = ['w'] + v"),
"from top.mod import __dunder_var__ as v\n__dunder_var__ = ['w'] + v",
module_name="top",
)
parse("__dunder_var__ = ['v']", module_name="top.mod")
Expand Down

0 comments on commit 58bbe0f

Please sign in to comment.