Skip to content

Commit 95bb118

Browse files
committed
test: update formatting of multi-line annotations
It's hard to grok the change from the snapshot diffs alone, so here's one example. Before: PYI021.pyi:15:5: PYI021 [*] Docstrings should not be included in stubs | 14 | class Baz: 15 | """Multiline docstring | _____^ 16 | | 17 | | Lorem ipsum dolor sit amet 18 | | """ | |_______^ PYI021 19 | 20 | def __init__(self) -> None: ... | = help: Remove docstring And now after: PYI021.pyi:15:5: PYI021 [*] Docstrings should not be included in stubs | 14 | class Baz: 15 | / """Multiline docstring 16 | | 17 | | Lorem ipsum dolor sit amet 18 | | """ | |_______^ PYI021 19 | 20 | def __init__(self) -> None: ... | = help: Remove docstring I personally think both of these are fine. If we felt strongly, I could investigate reverting to the old style, but the new style seems okay to me. In other words, these updates I believe are just cosmetic and not a bug fix.
1 parent a71cc62 commit 95bb118

File tree

109 files changed

+1290
-1802
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+1290
-1802
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,90 @@
11
---
22
source: crates/ruff_linter/src/rules/flake8_async/mod.rs
3-
snapshot_kind: text
43
---
54
ASYNC100.py:8:5: ASYNC100 A `with trio.fail_after(...):` context does not contain any `await` statements. This makes it pointless, as the timeout can only be triggered by a checkpoint.
65
|
76
7 | async def func():
8-
8 | with trio.fail_after():
9-
| _____^
7+
8 | / with trio.fail_after():
108
9 | | ...
119
| |___________^ ASYNC100
1210
|
1311

1412
ASYNC100.py:18:5: ASYNC100 A `with trio.move_on_after(...):` context does not contain any `await` statements. This makes it pointless, as the timeout can only be triggered by a checkpoint.
1513
|
1614
17 | async def func():
17-
18 | with trio.move_on_after():
18-
| _____^
15+
18 | / with trio.move_on_after():
1916
19 | | ...
2017
| |___________^ ASYNC100
2118
|
2219

2320
ASYNC100.py:45:5: ASYNC100 A `with anyio.move_on_after(...):` context does not contain any `await` statements. This makes it pointless, as the timeout can only be triggered by a checkpoint.
2421
|
2522
44 | async def func():
26-
45 | with anyio.move_on_after(delay=0.2):
27-
| _____^
23+
45 | / with anyio.move_on_after(delay=0.2):
2824
46 | | ...
2925
| |___________^ ASYNC100
3026
|
3127

3228
ASYNC100.py:50:5: ASYNC100 A `with anyio.fail_after(...):` context does not contain any `await` statements. This makes it pointless, as the timeout can only be triggered by a checkpoint.
3329
|
3430
49 | async def func():
35-
50 | with anyio.fail_after():
36-
| _____^
31+
50 | / with anyio.fail_after():
3732
51 | | ...
3833
| |___________^ ASYNC100
3934
|
4035

4136
ASYNC100.py:55:5: ASYNC100 A `with anyio.CancelScope(...):` context does not contain any `await` statements. This makes it pointless, as the timeout can only be triggered by a checkpoint.
4237
|
4338
54 | async def func():
44-
55 | with anyio.CancelScope():
45-
| _____^
39+
55 | / with anyio.CancelScope():
4640
56 | | ...
4741
| |___________^ ASYNC100
4842
|
4943

5044
ASYNC100.py:60:5: ASYNC100 A `with anyio.CancelScope(...):` context does not contain any `await` statements. This makes it pointless, as the timeout can only be triggered by a checkpoint.
5145
|
5246
59 | async def func():
53-
60 | with anyio.CancelScope(), nullcontext():
54-
| _____^
47+
60 | / with anyio.CancelScope(), nullcontext():
5548
61 | | ...
5649
| |___________^ ASYNC100
5750
|
5851

5952
ASYNC100.py:65:5: ASYNC100 A `with anyio.CancelScope(...):` context does not contain any `await` statements. This makes it pointless, as the timeout can only be triggered by a checkpoint.
6053
|
6154
64 | async def func():
62-
65 | with nullcontext(), anyio.CancelScope():
63-
| _____^
55+
65 | / with nullcontext(), anyio.CancelScope():
6456
66 | | ...
6557
| |___________^ ASYNC100
6658
|
6759

6860
ASYNC100.py:70:5: ASYNC100 A `with asyncio.timeout(...):` context does not contain any `await` statements. This makes it pointless, as the timeout can only be triggered by a checkpoint.
6961
|
7062
69 | async def func():
71-
70 | async with asyncio.timeout(delay=0.2):
72-
| _____^
63+
70 | / async with asyncio.timeout(delay=0.2):
7364
71 | | ...
7465
| |___________^ ASYNC100
7566
|
7667

7768
ASYNC100.py:75:5: ASYNC100 A `with asyncio.timeout_at(...):` context does not contain any `await` statements. This makes it pointless, as the timeout can only be triggered by a checkpoint.
7869
|
7970
74 | async def func():
80-
75 | async with asyncio.timeout_at(when=0.2):
81-
| _____^
71+
75 | / async with asyncio.timeout_at(when=0.2):
8272
76 | | ...
8373
| |___________^ ASYNC100
8474
|
8575

8676
ASYNC100.py:85:5: ASYNC100 A `with asyncio.timeout(...):` context does not contain any `await` statements. This makes it pointless, as the timeout can only be triggered by a checkpoint.
8777
|
8878
84 | async def func():
89-
85 | async with asyncio.timeout(delay=0.2), asyncio.TaskGroup(), asyncio.timeout(delay=0.2):
90-
| _____^
79+
85 | / async with asyncio.timeout(delay=0.2), asyncio.TaskGroup(), asyncio.timeout(delay=0.2):
9180
86 | | ...
9281
| |___________^ ASYNC100
9382
|
9483

9584
ASYNC100.py:95:5: ASYNC100 A `with asyncio.timeout(...):` context does not contain any `await` statements. This makes it pointless, as the timeout can only be triggered by a checkpoint.
9685
|
9786
94 | async def func():
98-
95 | async with asyncio.timeout(delay=0.2), asyncio.timeout(delay=0.2):
99-
| _____^
87+
95 | / async with asyncio.timeout(delay=0.2), asyncio.timeout(delay=0.2):
10088
96 | | ...
10189
| |___________^ ASYNC100
10290
|
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,42 @@
11
---
22
source: crates/ruff_linter/src/rules/flake8_async/mod.rs
3-
snapshot_kind: text
43
---
54
ASYNC110.py:7:5: ASYNC110 Use `trio.Event` instead of awaiting `trio.sleep` in a `while` loop
65
|
76
6 | async def func():
8-
7 | while True:
9-
| _____^
7+
7 | / while True:
108
8 | | await trio.sleep(10)
119
| |____________________________^ ASYNC110
1210
|
1311

1412
ASYNC110.py:12:5: ASYNC110 Use `trio.Event` instead of awaiting `trio.sleep` in a `while` loop
1513
|
1614
11 | async def func():
17-
12 | while True:
18-
| _____^
15+
12 | / while True:
1916
13 | | await trio.sleep_until(10)
2017
| |__________________________________^ ASYNC110
2118
|
2219

2320
ASYNC110.py:22:5: ASYNC110 Use `asyncio.Event` instead of awaiting `asyncio.sleep` in a `while` loop
2421
|
2522
21 | async def func():
26-
22 | while True:
27-
| _____^
23+
22 | / while True:
2824
23 | | await anyio.sleep(10)
2925
| |_____________________________^ ASYNC110
3026
|
3127

3228
ASYNC110.py:27:5: ASYNC110 Use `asyncio.Event` instead of awaiting `asyncio.sleep` in a `while` loop
3329
|
3430
26 | async def func():
35-
27 | while True:
36-
| _____^
31+
27 | / while True:
3732
28 | | await anyio.sleep_until(10)
3833
| |___________________________________^ ASYNC110
3934
|
4035

4136
ASYNC110.py:37:5: ASYNC110 Use `anyio.Event` instead of awaiting `anyio.sleep` in a `while` loop
4237
|
4338
36 | async def func():
44-
37 | while True:
45-
| _____^
39+
37 | / while True:
4640
38 | | await asyncio.sleep(10)
4741
| |_______________________________^ ASYNC110
4842
|

0 commit comments

Comments
 (0)