Skip to content

Commit a985622

Browse files
[pre-commit.ci] pre-commit autoupdate
updates: - [github.com/astral-sh/ruff-pre-commit: v0.7.4 → v0.8.1](astral-sh/ruff-pre-commit@v0.7.4...v0.8.1) (and others not listed here)
1 parent d0b0dd2 commit a985622

29 files changed

+189
-167
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ repos:
2020
doc/data/messages/m/missing-final-newline/bad/crlf.py
2121
)$
2222
- repo: https://github.com/astral-sh/ruff-pre-commit
23-
rev: "v0.7.4"
23+
rev: "v0.8.1"
2424
hooks:
2525
- id: ruff
2626
args: ["--fix"]
@@ -144,7 +144,7 @@ repos:
144144
]
145145
exclude: tests(/\w*)*/functional/|tests/input|tests(/.*)+/conftest.py|doc/data/messages|tests(/\w*)*data/
146146
- repo: https://github.com/rbubley/mirrors-prettier
147-
rev: v3.3.3
147+
rev: v3.4.1
148148
hooks:
149149
- id: prettier
150150
args: [--prose-wrap=always, --print-width=88]
@@ -171,7 +171,7 @@ repos:
171171
setup.cfg
172172
)$
173173
- repo: https://github.com/PyCQA/bandit
174-
rev: 1.7.10
174+
rev: 1.8.0
175175
hooks:
176176
- id: bandit
177177
args: ["-r", "-lll"]

pylint/__init__.py

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

77
__all__ = [
88
"__version__",
9-
"version",
109
"modify_sys_path",
1110
"run_pylint",
12-
"run_symilar",
1311
"run_pyreverse",
12+
"run_symilar",
13+
"version",
1414
]
1515

1616
import os

pylint/checkers/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ def initialize(linter: PyLinter) -> None:
132132

133133
__all__ = [
134134
"BaseChecker",
135-
"BaseTokenChecker",
136135
"BaseRawFileChecker",
137-
"initialize",
136+
"BaseTokenChecker",
138137
"DeprecatedMixin",
138+
"initialize",
139139
"register_plugins",
140140
]

pylint/checkers/base/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
from __future__ import annotations
88

99
__all__ = [
10+
"KNOWN_NAME_TYPES_WITH_STYLE",
11+
"AnyStyle",
12+
"CamelCaseStyle",
1013
"NameChecker",
1114
"NamingStyle",
12-
"KNOWN_NAME_TYPES_WITH_STYLE",
15+
"PascalCaseStyle",
1316
"SnakeCaseStyle",
14-
"CamelCaseStyle",
1517
"UpperCaseStyle",
16-
"PascalCaseStyle",
17-
"AnyStyle",
1818
]
1919

2020
from typing import TYPE_CHECKING

pylint/checkers/base/basic_checker.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,8 +517,7 @@ def _has_variadic_argument(
517517
args: list[nodes.Starred | nodes.Keyword], variadic_name: str
518518
) -> bool:
519519
return not args or any(
520-
isinstance(a.value, nodes.Name)
521-
and a.value.name != variadic_name
520+
(isinstance(a.value, nodes.Name) and a.value.name != variadic_name)
522521
or not isinstance(a.value, nodes.Name)
523522
for a in args
524523
)

pylint/checkers/base/basic_error_checker.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,9 @@ def visit_functiondef(self, node: nodes.FunctionDef) -> None:
268268
if not redefined_by_decorator(
269269
node
270270
) and not utils.is_registered_in_singledispatch_function(node):
271-
self._check_redefinition(node.is_method() and "method" or "function", node)
271+
self._check_redefinition(
272+
(node.is_method() and "method") or "function", node
273+
)
272274
# checks for max returns, branch, return in __init__
273275
returns = node.nodes_of_class(
274276
nodes.Return, skip_klass=(nodes.FunctionDef, nodes.ClassDef)

pylint/checkers/base/name_checker/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
# Copyright (c) https://github.com/pylint-dev/pylint/blob/main/CONTRIBUTORS.txt
44

55
__all__ = [
6+
"KNOWN_NAME_TYPES_WITH_STYLE",
7+
"AnyStyle",
8+
"CamelCaseStyle",
69
"NameChecker",
710
"NamingStyle",
8-
"KNOWN_NAME_TYPES_WITH_STYLE",
11+
"PascalCaseStyle",
912
"SnakeCaseStyle",
10-
"CamelCaseStyle",
1113
"UpperCaseStyle",
12-
"PascalCaseStyle",
13-
"AnyStyle",
1414
]
1515

1616
from pylint.checkers.base.name_checker.checker import NameChecker

pylint/checkers/deprecated.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,9 @@ def check_deprecated_attribute(self, node: astroid.Attribute) -> None:
230230
def check_deprecated_module(self, node: nodes.Import, mod_path: str | None) -> None:
231231
"""Checks if the module is deprecated."""
232232
for mod_name in self.deprecated_modules():
233-
if mod_path == mod_name or mod_path and mod_path.startswith(mod_name + "."):
233+
if mod_path == mod_name or (
234+
mod_path and mod_path.startswith(mod_name + ".")
235+
):
234236
self.add_message("deprecated-module", node=node, args=mod_path)
235237

236238
def check_deprecated_method(self, node: nodes.Call, inferred: nodes.NodeNG) -> None:

pylint/checkers/dunder_methods.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ def within_dunder_or_lambda_def(node: nodes.NodeNG) -> bool:
5959
isinstance(parent, nodes.FunctionDef)
6060
and parent.name.startswith("__")
6161
and parent.name.endswith("__")
62-
or DunderCallChecker.is_lambda_rule_exception(parent, node)
63-
):
62+
) or DunderCallChecker.is_lambda_rule_exception(parent, node):
6463
return True
6564
parent = parent.parent
6665
return False

pylint/checkers/exceptions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,9 @@ def _check_raise_missing_from(self, node: nodes.Raise) -> None:
405405
confidence=HIGH,
406406
)
407407
elif (
408-
isinstance(node.exc, nodes.Call)
409-
and isinstance(node.exc.func, nodes.Name)
410-
or isinstance(node.exc, nodes.Name)
408+
isinstance(node.exc, nodes.Call) and isinstance(node.exc.func, nodes.Name)
409+
) or (
410+
isinstance(node.exc, nodes.Name)
411411
and node.exc.name != containing_except_node.name.name
412412
):
413413
# We have a `raise SomeException(whatever)` or a `raise SomeException`

0 commit comments

Comments
 (0)