Skip to content

Commit 63a9ed3

Browse files
Merge remote-tracking branch 'origin/main' into issue8808_wrongimportorder
2 parents e98aeef + 6f83d5a commit 63a9ed3

34 files changed

+248
-51
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ repos:
1717
doc/data/messages/m/missing-final-newline/bad/crlf.py
1818
)$
1919
- repo: https://github.com/astral-sh/ruff-pre-commit
20-
rev: "v0.1.4"
20+
rev: "v0.1.5"
2121
hooks:
2222
- id: ruff
2323
args: ["--fix"]
@@ -39,7 +39,7 @@ repos:
3939
- id: isort
4040
exclude: doc/data/messages/
4141
- repo: https://github.com/psf/black
42-
rev: 23.10.1
42+
rev: 23.11.0
4343
hooks:
4444
- id: black
4545
args: [--safe, --quiet]
@@ -112,7 +112,7 @@ repos:
112112
files: ^(doc/(.*/)*.*\.rst)
113113
additional_dependencies: [Sphinx==5.0.1]
114114
- repo: https://github.com/pre-commit/mirrors-mypy
115-
rev: v1.6.1
115+
rev: v1.7.0
116116
hooks:
117117
- id: mypy
118118
name: mypy
@@ -131,7 +131,7 @@ repos:
131131
]
132132
exclude: tests(/\w*)*/functional/|tests/input|tests(/.*)+/conftest.py|doc/data/messages|tests(/\w*)*data/
133133
- repo: https://github.com/pre-commit/mirrors-prettier
134-
rev: v3.0.3
134+
rev: v3.1.0
135135
hooks:
136136
- id: prettier
137137
args: [--prose-wrap=always, --print-width=88]

doc/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Sphinx==7.2.6
22
sphinx-reredirects<1
3-
towncrier~=23.10
3+
towncrier~=23.11
44
furo==2023.9.10
55
-e .

doc/user_guide/usage/run.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,11 @@ command line using the ``--rcfile`` option. Otherwise, Pylint searches for a
9595
configuration file in the following order and uses the first one it finds:
9696

9797
#. ``pylintrc`` in the current working directory
98+
#. ``pylintrc.toml`` in the current working directory,
99+
providing it has at least one ``tool.pylint.`` section.
98100
#. ``.pylintrc`` in the current working directory
101+
#. ``.pylintrc.toml`` in the current working directory,
102+
providing it has at least one ``tool.pylint.`` section.
99103
#. ``pyproject.toml`` in the current working directory,
100104
providing it has at least one ``tool.pylint.`` section.
101105
The ``pyproject.toml`` must prepend section names with ``tool.pylint.``,
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Extend broad-exception-raised and broad-exception-caught to except*.
2+
3+
Closes #8827
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Exempt ``TypedDict`` from ``typing_extensions`` from ``too-many-ancestor`` checks.
2+
3+
Refs #9167
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Fixed incorrect suggestion for shallow copy in unnecessary-comprehension
2+
3+
Example of the suggestion:
4+
#pylint: disable=missing-module-docstring
5+
a = [1, 2, 3]
6+
b = [x for x in a]
7+
b[0] = 0
8+
print(a) # [1, 2, 3]
9+
10+
After changing b = [x for x in a] to b = a based on the suggestion, the script now prints [0, 2, 3]. The correct suggestion should be use list(a) to preserve the original behavior.
11+
12+
Closes #9172
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Support for resolving external toml files named pylintrc.toml and .pylintrc.toml.
2+
3+
Closes #9228

pylint/checkers/base/basic_checker.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,10 @@ def visit_expr(self, node: nodes.Expr) -> None:
478478
# side effects), else pointless-statement
479479
if (
480480
isinstance(expr, (nodes.Yield, nodes.Await))
481-
or (isinstance(node.parent, nodes.Try) and node.parent.body == [node])
481+
or (
482+
isinstance(node.parent, (nodes.Try, nodes.TryStar))
483+
and node.parent.body == [node]
484+
)
482485
or (isinstance(expr, nodes.Const) and expr.value is Ellipsis)
483486
):
484487
return

pylint/checkers/base_checker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,10 @@ def create_message_definition_from_tuple(
188188
default_scope = WarningScope.NODE
189189
options: ExtraMessageOptions = {}
190190
if len(msg_tuple) == 4:
191-
(msg, symbol, descr, msg_options) = msg_tuple # type: ignore[misc]
191+
(msg, symbol, descr, msg_options) = msg_tuple
192192
options = ExtraMessageOptions(**msg_options)
193193
elif len(msg_tuple) == 3:
194-
(msg, symbol, descr) = msg_tuple # type: ignore[misc]
194+
(msg, symbol, descr) = msg_tuple
195195
else:
196196
error_msg = """Messages should have a msgid, a symbol and a description. Something like this :
197197

pylint/checkers/exceptions.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,10 @@ def visit_compare(self, node: nodes.Compare) -> None:
556556
"catching-non-exception",
557557
"duplicate-except",
558558
)
559+
def visit_trystar(self, node: nodes.TryStar) -> None:
560+
"""Check for empty except*."""
561+
self.visit_try(node)
562+
559563
def visit_try(self, node: nodes.Try) -> None:
560564
"""Check for empty except."""
561565
self._check_try_except_raise(node)

0 commit comments

Comments
 (0)