Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#346)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.9.3 → v0.9.4](astral-sh/ruff-pre-commit@v0.9.3...v0.9.4)
- [github.com/psf/black: 24.10.0 → 25.1.0](psf/black@24.10.0...25.1.0)
- [github.com/RobertCraigie/pyright-python: v1.1.392.post0 → v1.1.393](RobertCraigie/pyright-python@v1.1.392.post0...v1.1.393)
- [github.com/codespell-project/codespell: v2.4.0 → v2.4.1](codespell-project/codespell@v2.4.0...v2.4.1)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Feb 4, 2025
1 parent 7a2a67b commit 411ebb6
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down
6 changes: 4 additions & 2 deletions flake8_async/visitors/visitor2xx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`."
),
Expand Down Expand Up @@ -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(...)`."
Expand Down
2 changes: 1 addition & 1 deletion flake8_async/visitors/visitor91x.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()`."
Expand Down
12 changes: 8 additions & 4 deletions flake8_async/visitors/visitors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down
1 change: 0 additions & 1 deletion tests/eval_files/async111.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 411ebb6

Please sign in to comment.