Skip to content

Commit e53c7ef

Browse files
A5rocksjakkdl
andauthored
Disable ruff's COM812 (#3144)
* Disable ruff's COM812 --------- Co-authored-by: John Litborn <11260241+jakkdl@users.noreply.github.com>
1 parent b43383d commit e53c7ef

File tree

4 files changed

+21
-35
lines changed

4 files changed

+21
-35
lines changed

pyproject.toml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,18 @@ select = [
131131
"YTT", # flake8-2020
132132
]
133133
extend-ignore = [
134-
'A002', # builtin-argument-shadowing
135-
'ANN401', # any-type (mypy's `disallow_any_explicit` is better)
136-
'E402', # module-import-not-at-top-of-file (usually OS-specific)
137-
'E501', # line-too-long
138-
'F403', # undefined-local-with-import-star
139-
'F405', # undefined-local-with-import-star-usage
140-
'PERF203', # try-except-in-loop (not always possible to refactor)
141-
'PT012', # multiple statements in pytest.raises block
142-
'SIM117', # multiple-with-statements (messes up lots of context-based stuff and looks bad)
134+
"A002", # builtin-argument-shadowing
135+
"ANN401", # any-type (mypy's `disallow_any_explicit` is better)
136+
"E402", # module-import-not-at-top-of-file (usually OS-specific)
137+
"E501", # line-too-long
138+
"F403", # undefined-local-with-import-star
139+
"F405", # undefined-local-with-import-star-usage
140+
"PERF203", # try-except-in-loop (not always possible to refactor)
141+
"PT012", # multiple statements in pytest.raises block
142+
"SIM117", # multiple-with-statements (messes up lots of context-based stuff and looks bad)
143+
144+
# conflicts with formatter (ruff recommends these be disabled)
145+
"COM812",
143146
]
144147

145148
[tool.ruff.lint.per-file-ignores]

src/trio/_core/_generated_io_kqueue.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ def current_kqueue() -> select.kqueue:
4545

4646
@enable_ki_protection
4747
def monitor_kevent(
48-
ident: int,
49-
filter: int,
48+
ident: int, filter: int
5049
) -> AbstractContextManager[_core.UnboundedQueue[select.kevent]]:
5150
"""TODO: these are implemented, but are currently more of a sketch than
5251
anything real. See `#26
@@ -60,19 +59,15 @@ def monitor_kevent(
6059

6160
@enable_ki_protection
6261
async def wait_kevent(
63-
ident: int,
64-
filter: int,
65-
abort_func: Callable[[RaiseCancelT], Abort],
62+
ident: int, filter: int, abort_func: Callable[[RaiseCancelT], Abort]
6663
) -> Abort:
6764
"""TODO: these are implemented, but are currently more of a sketch than
6865
anything real. See `#26
6966
<https://github.com/python-trio/trio/issues/26>`__.
7067
"""
7168
try:
7269
return await GLOBAL_RUN_CONTEXT.runner.io_manager.wait_kevent(
73-
ident,
74-
filter,
75-
abort_func,
70+
ident, filter, abort_func
7671
)
7772
except AttributeError:
7873
raise RuntimeError("must be called from async context") from None

src/trio/_core/_generated_io_windows.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -136,18 +136,15 @@ async def wait_overlapped(handle_: int | CData, lpOverlapped: CData | int) -> ob
136136
"""
137137
try:
138138
return await GLOBAL_RUN_CONTEXT.runner.io_manager.wait_overlapped(
139-
handle_,
140-
lpOverlapped,
139+
handle_, lpOverlapped
141140
)
142141
except AttributeError:
143142
raise RuntimeError("must be called from async context") from None
144143

145144

146145
@enable_ki_protection
147146
async def write_overlapped(
148-
handle: int | CData,
149-
data: Buffer,
150-
file_offset: int = 0,
147+
handle: int | CData, data: Buffer, file_offset: int = 0
151148
) -> int:
152149
"""TODO: these are implemented, but are currently more of a sketch than
153150
anything real. See `#26
@@ -156,19 +153,15 @@ async def write_overlapped(
156153
"""
157154
try:
158155
return await GLOBAL_RUN_CONTEXT.runner.io_manager.write_overlapped(
159-
handle,
160-
data,
161-
file_offset,
156+
handle, data, file_offset
162157
)
163158
except AttributeError:
164159
raise RuntimeError("must be called from async context") from None
165160

166161

167162
@enable_ki_protection
168163
async def readinto_overlapped(
169-
handle: int | CData,
170-
buffer: Buffer,
171-
file_offset: int = 0,
164+
handle: int | CData, buffer: Buffer, file_offset: int = 0
172165
) -> int:
173166
"""TODO: these are implemented, but are currently more of a sketch than
174167
anything real. See `#26
@@ -177,9 +170,7 @@ async def readinto_overlapped(
177170
"""
178171
try:
179172
return await GLOBAL_RUN_CONTEXT.runner.io_manager.readinto_overlapped(
180-
handle,
181-
buffer,
182-
file_offset,
173+
handle, buffer, file_offset
183174
)
184175
except AttributeError:
185176
raise RuntimeError("must be called from async context") from None

src/trio/_core/_generated_run.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,7 @@ def spawn_system_task(
186186
"""
187187
try:
188188
return GLOBAL_RUN_CONTEXT.runner.spawn_system_task(
189-
async_fn,
190-
*args,
191-
name=name,
192-
context=context,
189+
async_fn, *args, name=name, context=context
193190
)
194191
except AttributeError:
195192
raise RuntimeError("must be called from async context") from None

0 commit comments

Comments
 (0)