Skip to content

Commit 58bbe0f

Browse files
Update pylint to 2.14.0b1 (#1553)
Co-authored-by: Pierre Sassoulas <[email protected]>
1 parent 5e1a1b7 commit 58bbe0f

9 files changed

+9
-60
lines changed

astroid/arguments.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def infer_argument(self, funcnode, name, context):
160160
"""
161161
if name in self.duplicated_keywords:
162162
raise InferenceError(
163-
"The arguments passed to {func!r} " " have duplicate keywords.",
163+
"The arguments passed to {func!r} have duplicate keywords.",
164164
call_site=self,
165165
func=funcnode,
166166
arg=name,

astroid/brain/brain_gi.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
"__nonzero__",
4242
"__next__",
4343
"__str__",
44-
"__len__",
4544
"__contains__",
4645
"__enter__",
4746
"__exit__",

astroid/builder.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ class AstroidBuilder(raw_building.InspectBuilder):
6262
by default being True.
6363
"""
6464

65-
# pylint: disable=redefined-outer-name
6665
def __init__(self, manager=None, apply_transforms=True):
6766
super().__init__(manager)
6867
self._apply_transforms = apply_transforms

astroid/manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ def infer_ast_from_something(self, obj, context=None):
326326
) from exc
327327
except Exception as exc:
328328
raise AstroidImportError(
329-
"Unexpected error while retrieving name for {class_repr}:\n" "{error}",
329+
"Unexpected error while retrieving name for {class_repr}:\n{error}",
330330
cls=klass,
331331
class_repr=safe_repr(klass),
332332
) from exc

astroid/protocols.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ def __enter__(self):
608608
) from exc
609609
except TypeError as exc:
610610
raise InferenceError(
611-
"Tried to unpack a non-iterable value " "in {node!r}.",
611+
"Tried to unpack a non-iterable value in {node!r}.",
612612
node=self,
613613
targets=node,
614614
assign_path=assign_path,
@@ -677,7 +677,7 @@ def _determine_starred_iteration_lookups(starred, target, lookups):
677677
stmt = self.statement(future=True)
678678
if not isinstance(stmt, (nodes.Assign, nodes.For)):
679679
raise InferenceError(
680-
"Statement {stmt!r} enclosing {node!r} " "must be an Assign or For node.",
680+
"Statement {stmt!r} enclosing {node!r} must be an Assign or For node.",
681681
node=self,
682682
stmt=stmt,
683683
unknown=node,
@@ -696,7 +696,7 @@ def _determine_starred_iteration_lookups(starred, target, lookups):
696696

697697
if sum(1 for _ in lhs.nodes_of_class(nodes.Starred)) > 1:
698698
raise InferenceError(
699-
"Too many starred arguments in the " " assignment targets {lhs!r}.",
699+
"Too many starred arguments in the assignment targets {lhs!r}.",
700700
node=self,
701701
targets=lhs,
702702
unknown=node,

astroid/rebuilder.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ def _get_position_info(
169169
else:
170170
return None
171171

172-
# pylint: disable=undefined-loop-variable
173172
return Position(
174173
lineno=node.lineno + start_token.start[0] - 1,
175174
col_offset=start_token.start[1],
@@ -222,7 +221,6 @@ def _fix_doc_node_position(self, node: NodesWithDocsType) -> None:
222221
else:
223222
return
224223

225-
# pylint: disable=undefined-loop-variable
226224
node.doc_node.lineno = lineno + t.start[0] - 1
227225
node.doc_node.col_offset = t.start[1]
228226
node.doc_node.end_lineno = lineno + t.end[0] - 1

pylintrc

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
# pygtk.require().
88
#init-hook=
99

10-
# Profiled execution.
11-
profile=no
12-
1310
# Add files or directories to the blacklist. They should be base names, not
1411
# paths.
1512
ignore=CVS
@@ -53,11 +50,6 @@ py-version = 3.6.2
5350
# mypackage.mymodule.MyReporterClass.
5451
output-format=text
5552

56-
# Put messages in a separate file for each module / package specified on the
57-
# command line instead of printing them on stdout. Reports (if any) will be
58-
# written in a file name "pylint_global.[txt|html]".
59-
files-output=no
60-
6153
# Tells whether to display a full report or only the messages
6254
reports=no
6355

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

147-
# Naming hint for attribute names
148-
attr-name-hint=[a-z_][a-z0-9_]{2,30}$
149-
150135
# Regular expression matching correct constant names
151136
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
152137

153-
# Naming hint for constant names
154-
const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$
155-
156138
# Regular expression matching correct method names
157139
method-rgx=[a-z_][a-z0-9_]{2,30}$
158140

159-
# Naming hint for method names
160-
method-name-hint=[a-z_][a-z0-9_]{2,30}$
161-
162141
# Regular expression matching correct inline iteration names
163142
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
164143

165-
# Naming hint for inline iteration names
166-
inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$
167-
168144
# Regular expression matching correct class names
169145
class-rgx=[A-Z_][a-zA-Z0-9]+$
170146

171-
# Naming hint for class names
172-
class-name-hint=[A-Z_][a-zA-Z0-9]+$
173-
174147
# Regular expression matching correct argument names
175148
argument-rgx=[a-z_][a-z0-9_]{2,30}$
176149

177-
# Naming hint for argument names
178-
argument-name-hint=[a-z_][a-z0-9_]{2,30}$
179-
180150
# Regular expression matching correct module names
181151
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
182152

183-
# Naming hint for module names
184-
module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
185-
186153
# Regular expression matching correct function names
187154
function-rgx=[a-z_][a-z0-9_]{2,30}$
188155

189-
# Naming hint for function names
190-
function-name-hint=[a-z_][a-z0-9_]{2,30}$
191-
192156
# Regular expression matching correct variable names
193157
variable-rgx=[a-z_][a-z0-9_]{2,30}$
194158

195-
# Naming hint for variable names
196-
variable-name-hint=[a-z_][a-z0-9_]{2,30}$
197-
198159
# Regular expression matching correct class attribute names
199160
class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
200161

201-
# Naming hint for class attribute names
202-
class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
203-
204162
# Regular expression which should only match function or class names that do
205163

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

226-
# List of optional constructs for which whitespace checking is disabled
227-
no-space-check=trailing-comma,dict-separator
228-
229184
# Maximum number of lines in a module
230185
max-module-lines=3000
231186

requirements_test_pre_commit.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
black==22.3.0
2-
pylint~=2.13.8
2+
pylint==2.14.0b1
33
isort==5.10.1
44
flake8==4.0.1
55
flake8-typing-imports==1.12.0

tests/unittest_inference.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6632,7 +6632,7 @@ def test_imported_module_var_inferable(self) -> None:
66326632
"""
66336633
Module variables can be imported and inferred successfully as part of binary operators.
66346634
"""
6635-
mod1 = parse(("from top.mod import v as z\n" "w = [1] + z"), module_name="top")
6635+
mod1 = parse("from top.mod import v as z\nw = [1] + z", module_name="top")
66366636
parse("v = [2]", module_name="top.mod")
66376637
w_val = mod1.body[-1].value
66386638
i_w_val = next(w_val.infer())
@@ -6641,9 +6641,7 @@ def test_imported_module_var_inferable(self) -> None:
66416641

66426642
def test_imported_module_var_inferable2(self) -> None:
66436643
"""Version list of strings."""
6644-
mod1 = parse(
6645-
("from top.mod import v as z\n" "w = ['1'] + z"), module_name="top"
6646-
)
6644+
mod1 = parse("from top.mod import v as z\nw = ['1'] + z", module_name="top")
66476645
parse("v = ['2']", module_name="top.mod")
66486646
w_val = mod1.body[-1].value
66496647
i_w_val = next(w_val.infer())
@@ -6653,7 +6651,7 @@ def test_imported_module_var_inferable2(self) -> None:
66536651
def test_imported_module_var_inferable3(self) -> None:
66546652
"""Version list of strings with a __dunder__ name."""
66556653
mod1 = parse(
6656-
("from top.mod import __dunder_var__ as v\n" "__dunder_var__ = ['w'] + v"),
6654+
"from top.mod import __dunder_var__ as v\n__dunder_var__ = ['w'] + v",
66576655
module_name="top",
66586656
)
66596657
parse("__dunder_var__ = ['v']", module_name="top.mod")

0 commit comments

Comments
 (0)