Skip to content

Commit d3fa361

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

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

flake8_async/visitors/visitor2xx.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,7 @@ class Visitor23X(Visitor200):
253253
error_codes: Mapping[str, str] = {
254254
"ASYNC230": "Sync call {0} in async function, use `{1}.open_file(...)`.",
255255
"ASYNC231": "Sync call {0} in async function, use `{1}.wrap_file({0})`.",
256-
"ASYNC233": (
257-
"Sync call {0} on pathlib.Path in async function, use `{1}.Path`."
258-
),
256+
"ASYNC233": "Sync call {0} on pathlib.Path in async function, use `{1}.Path`.",
259257
"ASYNC230_asyncio": (
260258
"Sync call {0} in async function, "
261259
" use a library such as aiofiles or anyio."

tests/eval_files/async233.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@ async def foo(path: Path, other_path: pathlib.Path):
1717

1818
other_path.read_text() # ASYNC233: 4, 'other_path.read_text', "trio"
1919
Path("foo").read_text() # ASYNC233: 4, "Path('foo').read_text", "trio"
20-
pathlib.Path("foo").read_bytes() # ASYNC233: 4, "pathlib.Path('foo').read_bytes", "trio"
21-
pathlib.Path.cwd().write_text("content") # ASYNC233: 4, 'pathlib.Path.cwd().write_text', "trio"
20+
pathlib.Path(
21+
"foo"
22+
).read_bytes() # ASYNC233: 4, "pathlib.Path('foo').read_bytes", "trio"
23+
pathlib.Path.cwd().write_text(
24+
"content"
25+
) # ASYNC233: 4, 'pathlib.Path.cwd().write_text', "trio"
2226
UnixPath("foo").touch() # ASYNC233: 4, "UnixPath('foo').touch", "trio"
2327

2428
assigned = Path("foo")

0 commit comments

Comments
 (0)