diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5f71152f..4aef83a3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,13 +9,13 @@ ci: repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.9.3 + rev: v0.9.4 hooks: - id: ruff args: [--fix] - repo: https://github.com/psf/black - rev: 24.10.0 + rev: 25.1.0 hooks: - id: black args: [--preview] @@ -45,7 +45,7 @@ repos: exclude: tests/eval_files/.*_py311.py - repo: https://github.com/RobertCraigie/pyright-python - rev: v1.1.392.post0 + rev: v1.1.393 hooks: - id: pyright # ignore warnings about new version being available, no other warnings @@ -66,7 +66,7 @@ repos: - trio - repo: https://github.com/codespell-project/codespell - rev: v2.4.0 + rev: v2.4.1 hooks: - id: codespell additional_dependencies: diff --git a/flake8_async/visitors/visitor2xx.py b/flake8_async/visitors/visitor2xx.py index b49fe724..cd416d1f 100644 --- a/flake8_async/visitors/visitor2xx.py +++ b/flake8_async/visitors/visitor2xx.py @@ -186,7 +186,9 @@ class Visitor22X(Visitor200): "Sync call {} in async function, use " "`asyncio.create_subprocess_[exec/shell]." ), - "ASYNC222": "Sync call {} in async function, wrap in `{}.to_thread.run_sync()`.", + "ASYNC222": ( + "Sync call {} in async function, wrap in `{}.to_thread.run_sync()`." + ), "ASYNC222_asyncio": ( "Sync call {} in async function, use `asyncio.loop.run_in_executor`." ), @@ -397,7 +399,7 @@ def visit_Call(self, node: ast.Call): @error_class class Visitor25X(Visitor200): error_codes: Mapping[str, str] = { - "ASYNC250": ("Blocking sync call `input()` in async function. Wrap in `{}`."), + "ASYNC250": "Blocking sync call `input()` in async function. Wrap in `{}`.", "ASYNC251": ( "Blocking sync call `time.sleep(...)` in async function." " Use `await {}.sleep(...)`." diff --git a/flake8_async/visitors/visitor91x.py b/flake8_async/visitors/visitor91x.py index b664e64b..823e8f67 100644 --- a/flake8_async/visitors/visitor91x.py +++ b/flake8_async/visitors/visitor91x.py @@ -357,7 +357,7 @@ class Visitor91X(Flake8AsyncVisitor_cst, CommonVisitors): "CancelScope with no guaranteed cancel point. This makes it potentially " "impossible to cancel." ), - "ASYNC913": ("Indefinite loop with no guaranteed cancel points."), + "ASYNC913": "Indefinite loop with no guaranteed cancel points.", "ASYNC100": ( "{0}.{1} context contains no checkpoints, remove the context or add" " `await {0}.lowlevel.checkpoint()`." diff --git a/flake8_async/visitors/visitors.py b/flake8_async/visitors/visitors.py index 54f14cf2..91f47f45 100644 --- a/flake8_async/visitors/visitors.py +++ b/flake8_async/visitors/visitors.py @@ -319,8 +319,10 @@ def visit_Call(self, node: ast.Call): @error_class class Visitor119(Flake8AsyncVisitor): error_codes: Mapping[str, str] = { - "ASYNC119": "Yield in contextmanager in async generator might not trigger" - " cleanup. Use `@asynccontextmanager` or refactor." + "ASYNC119": ( + "Yield in contextmanager in async generator might not trigger" + " cleanup. Use `@asynccontextmanager` or refactor." + ) } def __init__(self, *args: Any, **kwargs: Any): @@ -490,8 +492,10 @@ def leave_IfExp_test(self, node: cst.IfExp): @disabled_by_default class Visitor900(Flake8AsyncVisitor): error_codes: Mapping[str, str] = { - "ASYNC900": "Async generator not allowed, unless transformed " - "by a known decorator (one of: {})." + "ASYNC900": ( + "Async generator not allowed, unless transformed " + "by a known decorator (one of: {})." + ) } def __init__(self, *args: Any, **kwargs: Any): diff --git a/tests/eval_files/async111.py b/tests/eval_files/async111.py index cf29a05a..2748460d 100644 --- a/tests/eval_files/async111.py +++ b/tests/eval_files/async111.py @@ -9,7 +9,6 @@ import trio import trio as noterror - # shed/black breaks up a *ton* of lines since adding more detailed error messages, so # disable formatting to avoid having to adjust a ton of line references # fmt: off