Skip to content

Commit df5533f

Browse files
[ruff] Activate pydocstyle and fix existing issues
1 parent 5261fcc commit df5533f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+72
-81
lines changed

examples/custom_raw.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212

1313
class MyRawChecker(BaseRawFileChecker):
14-
"""Check for line continuations with '\' instead of using triple
15-
quoted string or parenthesis
14+
r"""Check for line continuations with '\' instead of using triple
15+
quoted string or parenthesis.
1616
"""
1717

1818
name = "custom_raw"

pylint/checkers/base/comparison_checker.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ def _check_singleton_comparison(
8989
checking_for_absence: bool = False,
9090
) -> None:
9191
"""Check if == or != is being used to compare a singleton value."""
92-
9392
if utils.is_singleton_const(left_value):
9493
singleton, other_value = left_value.value, right_value
9594
elif utils.is_singleton_const(right_value):

pylint/checkers/classes/class_checker.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,6 @@ def _is_attribute_property(name: str, klass: nodes.ClassDef) -> bool:
454454
Returns ``True`` if the name is a property in the given klass,
455455
``False`` otherwise.
456456
"""
457-
458457
try:
459458
attributes = klass.getattr(name)
460459
except astroid.NotFoundError:
@@ -748,7 +747,6 @@ def __init__(self) -> None:
748747

749748
def set_accessed(self, node: _AccessNodes) -> None:
750749
"""Set the given node as accessed."""
751-
752750
frame = node_frame_class(node)
753751
if frame is None:
754752
# The node does not live in a class.
@@ -1946,7 +1944,6 @@ def _is_class_or_instance_attribute(name: str, klass: nodes.ClassDef) -> bool:
19461944
Returns ``True`` if the name is a property in the given klass,
19471945
``False`` otherwise.
19481946
"""
1949-
19501947
if utils.is_class_attr(name, klass):
19511948
return True
19521949

pylint/checkers/deprecated.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,6 @@ def check_deprecated_method(self, node: nodes.Call, inferred: nodes.NodeNG) -> N
236236
237237
This method should be called from the checker implementing this mixin.
238238
"""
239-
240239
# Reject nodes which aren't of interest to us.
241240
if not isinstance(inferred, ACCEPTABLE_NODES):
242241
return
@@ -272,7 +271,6 @@ def check_deprecated_class(
272271
self, node: nodes.NodeNG, mod_name: str, class_names: Iterable[str]
273272
) -> None:
274273
"""Checks if the class is deprecated."""
275-
276274
for class_name in class_names:
277275
if class_name in self.deprecated_classes(mod_name):
278276
self.add_message(
@@ -281,7 +279,6 @@ def check_deprecated_class(
281279

282280
def check_deprecated_class_in_call(self, node: nodes.Call) -> None:
283281
"""Checks if call the deprecated class."""
284-
285282
if isinstance(node.func, nodes.Attribute) and isinstance(
286283
node.func.expr, nodes.Name
287284
):

pylint/checkers/design_analysis.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@
185185

186186
def _is_exempt_from_public_methods(node: astroid.ClassDef) -> bool:
187187
"""Check if a class is exempt from too-few-public-methods."""
188-
189188
# If it's a typing.Namedtuple, typing.TypedDict or an Enum
190189
for ancestor in node.ancestors():
191190
if is_enum(ancestor):

pylint/checkers/imports.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,6 @@ def _add_imported_module(self, node: ImportNode, importedmodname: str) -> None:
10791079

10801080
def _check_preferred_module(self, node: ImportNode, mod_path: str) -> None:
10811081
"""Check if the module has a preferred replacement."""
1082-
10831082
mod_compare = [mod_path]
10841083
# build a comparison list of possible names using importfrom
10851084
if isinstance(node, astroid.nodes.node_classes.ImportFrom):

pylint/checkers/non_ascii_names.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ class NonAsciiNameChecker(base_checker.BaseChecker):
6565

6666
def _check_name(self, node_type: str, name: str | None, node: nodes.NodeNG) -> None:
6767
"""Check whether a name is using non-ASCII characters."""
68-
6968
if name is None:
7069
# For some nodes i.e. *kwargs from a dict, the name will be empty
7170
return

pylint/checkers/refactoring/recommendation_checker.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ def _check_use_maxsplit_arg(self, node: nodes.Call) -> None:
113113
"""Add message when accessing first or last elements of a str.split() or
114114
str.rsplit().
115115
"""
116-
117116
# Check if call is split() or rsplit()
118117
if not (
119118
isinstance(node.func, nodes.Attribute)

pylint/checkers/refactoring/refactoring_checker.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,6 @@ def _check_simplifiable_if(self, node: nodes.If) -> None:
586586
the result of the statement's test, then this can be reduced
587587
to `bool(test)` without losing any functionality.
588588
"""
589-
590589
if self._is_actual_elif(node):
591590
# Not interested in if statements with multiple branches.
592591
return

pylint/checkers/similar.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,6 @@ def _get_functions(
611611
"""Recursively get all functions including nested in the classes from the
612612
tree.
613613
"""
614-
615614
for node in tree.body:
616615
if isinstance(node, (nodes.FunctionDef, nodes.AsyncFunctionDef)):
617616
functions.append(node)

0 commit comments

Comments
 (0)