Skip to content

Commit 2a1c6c9

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 06b48f2 commit 2a1c6c9

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

flake8_async/visitors/visitor2xx.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,9 @@ class Visitor22X(Visitor200):
186186
"Sync call {} in async function, use "
187187
"`asyncio.create_subprocess_[exec/shell]."
188188
),
189-
"ASYNC222": "Sync call {} in async function, wrap in `{}.to_thread.run_sync()`.",
189+
"ASYNC222": (
190+
"Sync call {} in async function, wrap in `{}.to_thread.run_sync()`."
191+
),
190192
"ASYNC222_asyncio": (
191193
"Sync call {} in async function, use `asyncio.loop.run_in_executor`."
192194
),
@@ -397,7 +399,7 @@ def visit_Call(self, node: ast.Call):
397399
@error_class
398400
class Visitor25X(Visitor200):
399401
error_codes: Mapping[str, str] = {
400-
"ASYNC250": ("Blocking sync call `input()` in async function. Wrap in `{}`."),
402+
"ASYNC250": "Blocking sync call `input()` in async function. Wrap in `{}`.",
401403
"ASYNC251": (
402404
"Blocking sync call `time.sleep(...)` in async function."
403405
" Use `await {}.sleep(...)`."

flake8_async/visitors/visitor91x.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ class Visitor91X(Flake8AsyncVisitor_cst, CommonVisitors):
357357
"CancelScope with no guaranteed cancel point. This makes it potentially "
358358
"impossible to cancel."
359359
),
360-
"ASYNC913": ("Indefinite loop with no guaranteed cancel points."),
360+
"ASYNC913": "Indefinite loop with no guaranteed cancel points.",
361361
"ASYNC100": (
362362
"{0}.{1} context contains no checkpoints, remove the context or add"
363363
" `await {0}.lowlevel.checkpoint()`."

flake8_async/visitors/visitors.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,10 @@ def visit_Call(self, node: ast.Call):
319319
@error_class
320320
class Visitor119(Flake8AsyncVisitor):
321321
error_codes: Mapping[str, str] = {
322-
"ASYNC119": "Yield in contextmanager in async generator might not trigger"
323-
" cleanup. Use `@asynccontextmanager` or refactor."
322+
"ASYNC119": (
323+
"Yield in contextmanager in async generator might not trigger"
324+
" cleanup. Use `@asynccontextmanager` or refactor."
325+
)
324326
}
325327

326328
def __init__(self, *args: Any, **kwargs: Any):
@@ -490,8 +492,10 @@ def leave_IfExp_test(self, node: cst.IfExp):
490492
@disabled_by_default
491493
class Visitor900(Flake8AsyncVisitor):
492494
error_codes: Mapping[str, str] = {
493-
"ASYNC900": "Async generator not allowed, unless transformed "
494-
"by a known decorator (one of: {})."
495+
"ASYNC900": (
496+
"Async generator not allowed, unless transformed "
497+
"by a known decorator (one of: {})."
498+
)
495499
}
496500

497501
def __init__(self, *args: Any, **kwargs: Any):

tests/eval_files/async111.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import trio
1010
import trio as noterror
1111

12-
1312
# shed/black breaks up a *ton* of lines since adding more detailed error messages, so
1413
# disable formatting to avoid having to adjust a ton of line references
1514
# fmt: off

0 commit comments

Comments
 (0)