Skip to content

Commit 96cf94e

Browse files
committed
Merge branch 'dev' into additional-match-checks
2 parents 5502cd3 + 68ab16f commit 96cf94e

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

doc/user_guide/checkers/features.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ Async checker Messages
2929
Used when an async context manager is used with an object that does not
3030
implement the async context management protocol. This message can't be
3131
emitted when using Python < 3.5.
32-
:async-context-manager-with-regular-with (E1145): *Context manager '%s' is async and should be used with 'async with'.*
33-
Used when an async context manager is used with a regular 'with' statement
34-
instead of 'async with'.
3532

3633

3734
Bad-Chained-Comparison checker
@@ -1287,6 +1284,9 @@ Typecheck checker Messages
12871284
:invalid-slice-step (E1144): *Slice step cannot be 0*
12881285
Used when a slice step is 0 and the object doesn't implement a custom
12891286
__getitem__ method.
1287+
:async-context-manager-with-regular-with (E1145): *Context manager '%s' is async and should be used with 'async with'.*
1288+
Used when an async context manager is used with a regular 'with' statement
1289+
instead of 'async with'.
12901290
:keyword-arg-before-vararg (W1113): *Keyword argument before variable positional arguments list in the definition of %s function*
12911291
When defining a keyword argument before variable positional arguments, one
12921292
can end up in having multiple values passed for the aforementioned parameter
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Add new check ``async-context-manager-with-regular-with`` to detect async context managers used with regular ``with`` statements instead of ``async with``.
22

3-
Refs #10999
3+
Refs #10408

doc/whatsnew/fragments/10559.new_check

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Add new checks for invalid uses of class patterns in :keyword:`match`.
2+
23
* :ref:`invalid-match-args-definition` is emitted if :py:data:`object.__match_args__` isn't a tuple of strings.
34
* :ref:`too-many-positional-sub-patterns` if there are more positional sub-patterns than specified in :py:data:`object.__match_args__`.
45
* :ref:`multiple-class-sub-patterns` if there are multiple sub-patterns for the same attribute.

0 commit comments

Comments
 (0)