|
2 | 2 | source: crates/ruff_linter/src/rules/flake8_async/mod.rs |
3 | 3 | --- |
4 | 4 | ASYNC240 Async functions should not use os.path methods, use trio.Path or anyio.path |
5 | | - --> ASYNC240.py:63:5 |
| 5 | + --> ASYNC240.py:67:5 |
6 | 6 | | |
7 | | -61 | file = "file.txt" |
8 | | -62 | |
9 | | -63 | os.path.abspath(file) # ASYNC240 |
| 7 | +65 | file = "file.txt" |
| 8 | +66 | |
| 9 | +67 | os.path.abspath(file) # ASYNC240 |
10 | 10 | | ^^^^^^^^^^^^^^^ |
11 | | -64 | os.path.exists(file) # ASYNC240 |
| 11 | +68 | os.path.exists(file) # ASYNC240 |
12 | 12 | | |
13 | 13 |
|
14 | 14 | ASYNC240 Async functions should not use os.path methods, use trio.Path or anyio.path |
15 | | - --> ASYNC240.py:64:5 |
| 15 | + --> ASYNC240.py:68:5 |
16 | 16 | | |
17 | | -63 | os.path.abspath(file) # ASYNC240 |
18 | | -64 | os.path.exists(file) # ASYNC240 |
| 17 | +67 | os.path.abspath(file) # ASYNC240 |
| 18 | +68 | os.path.exists(file) # ASYNC240 |
19 | 19 | | ^^^^^^^^^^^^^^ |
20 | | -65 | |
21 | | -66 | async def pathlib_path_in_foo(): |
| 20 | +69 | |
| 21 | +70 | async def pathlib_path_in_foo(): |
22 | 22 | | |
23 | 23 |
|
24 | 24 | ASYNC240 Async functions should not use pathlib.Path methods, use trio.Path or anyio.path |
25 | | - --> ASYNC240.py:68:5 |
| 25 | + --> ASYNC240.py:72:5 |
26 | 26 | | |
27 | | -66 | async def pathlib_path_in_foo(): |
28 | | -67 | path = Path("src/my_text.txt") |
29 | | -68 | path.exists() # ASYNC240 |
| 27 | +70 | async def pathlib_path_in_foo(): |
| 28 | +71 | path = Path("src/my_text.txt") |
| 29 | +72 | path.exists() # ASYNC240 |
30 | 30 | | ^^^^^^^^^^^ |
31 | | -69 | with path.open() as f: # ASYNC240 |
32 | | -70 | ... |
33 | | - | |
34 | | - |
35 | | -ASYNC240 Async functions should not use pathlib.Path methods, use trio.Path or anyio.path |
36 | | - --> ASYNC240.py:69:10 |
37 | | - | |
38 | | -67 | path = Path("src/my_text.txt") |
39 | | -68 | path.exists() # ASYNC240 |
40 | | -69 | with path.open() as f: # ASYNC240 |
41 | | - | ^^^^^^^^^ |
42 | | -70 | ... |
| 31 | +73 | |
| 32 | +74 | async def pathlib_path_in_foo(): |
43 | 33 | | |
44 | 34 |
|
45 | 35 | ASYNC240 Async functions should not use pathlib.Path methods, use trio.Path or anyio.path |
46 | | - --> ASYNC240.py:76:5 |
| 36 | + --> ASYNC240.py:78:5 |
47 | 37 | | |
48 | | -75 | path = pathlib.Path("src/my_text.txt") |
49 | | -76 | path.exists() # ASYNC240 |
| 38 | +77 | path = pathlib.Path("src/my_text.txt") |
| 39 | +78 | path.exists() # ASYNC240 |
50 | 40 | | ^^^^^^^^^^^ |
51 | | -77 | with path.open() as f: # ASYNC240 |
52 | | -78 | ... |
53 | | - | |
54 | | - |
55 | | -ASYNC240 Async functions should not use pathlib.Path methods, use trio.Path or anyio.path |
56 | | - --> ASYNC240.py:77:10 |
57 | | - | |
58 | | -75 | path = pathlib.Path("src/my_text.txt") |
59 | | -76 | path.exists() # ASYNC240 |
60 | | -77 | with path.open() as f: # ASYNC240 |
61 | | - | ^^^^^^^^^ |
62 | | -78 | ... |
| 41 | +79 | |
| 42 | +80 | async def inline_path_method_call(): |
63 | 43 | | |
64 | 44 |
|
65 | 45 | ASYNC240 Async functions should not use pathlib.Path methods, use trio.Path or anyio.path |
66 | 46 | --> ASYNC240.py:81:5 |
67 | 47 | | |
68 | 48 | 80 | async def inline_path_method_call(): |
69 | | -81 | Path("src/my_text.txt").open() # ASYNC240 |
70 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
71 | | -82 | Path("src/my_text.txt").open().flush() # ASYNC240 |
72 | | -83 | with Path("src/my_text.txt").open() as f: # ASYNC240 |
| 49 | +81 | Path("src/my_text.txt").exists() # ASYNC240 |
| 50 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 51 | +82 | Path("src/my_text.txt").absolute().exists() # ASYNC240 |
73 | 52 | | |
74 | 53 |
|
75 | 54 | ASYNC240 Async functions should not use pathlib.Path methods, use trio.Path or anyio.path |
76 | 55 | --> ASYNC240.py:82:5 |
77 | 56 | | |
78 | 57 | 80 | async def inline_path_method_call(): |
79 | | -81 | Path("src/my_text.txt").open() # ASYNC240 |
80 | | -82 | Path("src/my_text.txt").open().flush() # ASYNC240 |
81 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
82 | | -83 | with Path("src/my_text.txt").open() as f: # ASYNC240 |
83 | | -84 | ... |
| 58 | +81 | Path("src/my_text.txt").exists() # ASYNC240 |
| 59 | +82 | Path("src/my_text.txt").absolute().exists() # ASYNC240 |
| 60 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 61 | +83 | |
| 62 | +84 | async def aliased_path_in_foo(): |
84 | 63 | | |
85 | 64 |
|
86 | 65 | ASYNC240 Async functions should not use pathlib.Path methods, use trio.Path or anyio.path |
87 | | - --> ASYNC240.py:83:10 |
| 66 | + --> ASYNC240.py:88:5 |
88 | 67 | | |
89 | | -81 | Path("src/my_text.txt").open() # ASYNC240 |
90 | | -82 | Path("src/my_text.txt").open().flush() # ASYNC240 |
91 | | -83 | with Path("src/my_text.txt").open() as f: # ASYNC240 |
92 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
93 | | -84 | ... |
94 | | - | |
95 | | - |
96 | | -ASYNC240 Async functions should not use pathlib.Path methods, use trio.Path or anyio.path |
97 | | - --> ASYNC240.py:90:5 |
98 | | - | |
99 | | -89 | path = PathAlias("src/my_text.txt") |
100 | | -90 | path.exists() # ASYNC240 |
| 68 | +87 | path = PathAlias("src/my_text.txt") |
| 69 | +88 | path.exists() # ASYNC240 |
101 | 70 | | ^^^^^^^^^^^ |
102 | | -91 | |
103 | | -92 | global_path = Path("src/my_text.txt") |
| 71 | +89 | |
| 72 | +90 | global_path = Path("src/my_text.txt") |
104 | 73 | | |
105 | 74 |
|
106 | 75 | ASYNC240 Async functions should not use pathlib.Path methods, use trio.Path or anyio.path |
107 | | - --> ASYNC240.py:95:5 |
| 76 | + --> ASYNC240.py:93:5 |
108 | 77 | | |
109 | | -94 | async def global_path_in_foo(): |
110 | | -95 | global_path.exists() # ASYNC240 |
| 78 | +92 | async def global_path_in_foo(): |
| 79 | +93 | global_path.exists() # ASYNC240 |
111 | 80 | | ^^^^^^^^^^^^^^^^^^ |
112 | | -96 | |
113 | | -97 | async def path_as_simple_parameter_type(path: Path): |
| 81 | +94 | |
| 82 | +95 | async def path_as_simple_parameter_type(path: Path): |
114 | 83 | | |
115 | 84 |
|
116 | 85 | ASYNC240 Async functions should not use pathlib.Path methods, use trio.Path or anyio.path |
117 | | - --> ASYNC240.py:98:5 |
118 | | - | |
119 | | - 97 | async def path_as_simple_parameter_type(path: Path): |
120 | | - 98 | path.exists() # ASYNC240 |
121 | | - | ^^^^^^^^^^^ |
122 | | - 99 | |
123 | | -100 | async def path_as_union_parameter_type(path: Path | None): |
124 | | - | |
| 86 | + --> ASYNC240.py:96:5 |
| 87 | + | |
| 88 | +95 | async def path_as_simple_parameter_type(path: Path): |
| 89 | +96 | path.exists() # ASYNC240 |
| 90 | + | ^^^^^^^^^^^ |
| 91 | +97 | |
| 92 | +98 | async def path_as_union_parameter_type(path: Path | None): |
| 93 | + | |
125 | 94 |
|
126 | 95 | ASYNC240 Async functions should not use pathlib.Path methods, use trio.Path or anyio.path |
127 | | - --> ASYNC240.py:101:5 |
| 96 | + --> ASYNC240.py:99:5 |
128 | 97 | | |
129 | | -100 | async def path_as_union_parameter_type(path: Path | None): |
130 | | -101 | path.exists() # ASYNC240 |
| 98 | + 98 | async def path_as_union_parameter_type(path: Path | None): |
| 99 | + 99 | path.exists() # ASYNC240 |
131 | 100 | | ^^^^^^^^^^^ |
132 | | -102 | |
133 | | -103 | async def path_as_optional_parameter_type(path: Optional[Path]): |
| 101 | +100 | |
| 102 | +101 | async def path_as_optional_parameter_type(path: Optional[Path]): |
134 | 103 | | |
135 | 104 |
|
136 | 105 | ASYNC240 Async functions should not use pathlib.Path methods, use trio.Path or anyio.path |
137 | | - --> ASYNC240.py:104:5 |
| 106 | + --> ASYNC240.py:102:5 |
138 | 107 | | |
139 | | -103 | async def path_as_optional_parameter_type(path: Optional[Path]): |
140 | | -104 | path.exists() # ASYNC240 |
| 108 | +101 | async def path_as_optional_parameter_type(path: Optional[Path]): |
| 109 | +102 | path.exists() # ASYNC240 |
141 | 110 | | ^^^^^^^^^^^ |
142 | 111 | | |
0 commit comments