Skip to content

Commit aec6643

Browse files
fix: Resolve failing linter checks (#1361)
* ci: weekly check. updates: - [github.com/charliermarsh/ruff-pre-commit: v0.0.254 → v0.0.261](astral-sh/ruff-pre-commit@v0.0.254...v0.0.261) - [github.com/psf/black: 23.1.0 → 23.3.0](psf/black@23.1.0...23.3.0) * fix: Resolve failing linter checks * ci: correct from checks. * scream: I swear this bot is trying to break my commits on purpose * Bump max-complexity to a number we're unlikely to hit --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent e94ed9f commit aec6643

File tree

14 files changed

+19
-17
lines changed

14 files changed

+19
-17
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ repos:
3030
- id: check-merge-conflict
3131
name: Merge Conflicts
3232
- repo: https://github.com/charliermarsh/ruff-pre-commit
33-
rev: 'v0.0.254'
33+
rev: 'v0.0.261'
3434
hooks:
3535
- id: ruff
3636
args: [--fix, --exit-non-zero-on-fix]
3737
- repo: https://github.com/psf/black
38-
rev: 23.1.0
38+
rev: 23.3.0
3939
hooks:
4040
- id: black
4141
name: Black Formatting

interactions/api/gateway/websocket.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ async def send_json(self, data: dict, bypass=False) -> None:
164164
serialized = FastJson.dumps(data)
165165
await self.send(serialized, bypass)
166166

167-
async def receive(self, force: bool = False) -> str:
167+
async def receive(self, force: bool = False) -> str: # noqa: C901
168168
"""
169169
Receive a full event payload from the WebSocket.
170170

interactions/api/http/http_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def _process_payload(
334334
form_data.add_field("payload_json", FastJson.dumps(payload))
335335
return form_data
336336

337-
async def request(
337+
async def request( # noqa: C901
338338
self,
339339
route: Route,
340340
payload: list | dict | None = None,

interactions/api/voice/voice_gateway.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ async def run(self) -> None:
100100
# possible race conditions to consider.
101101
await self.dispatch_opcode(data, op)
102102

103-
async def receive(self, force=False) -> str:
103+
async def receive(self, force=False) -> str: # noqa: C901
104104
buffer = bytearray()
105105

106106
while True:

interactions/client/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1691,7 +1691,7 @@ async def _run_slash_command(self, command: SlashCommand, ctx: "InteractionConte
16911691
return await command(ctx, **ctx.kwargs)
16921692

16931693
@processors.Processor.define("raw_interaction_create")
1694-
async def _dispatch_interaction(self, event: RawGatewayEvent) -> None:
1694+
async def _dispatch_interaction(self, event: RawGatewayEvent) -> None: # noqa: C901
16951695
"""
16961696
Identify and dispatch interaction of slash commands or components.
16971697

interactions/ext/debug_extension/debug_exec.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ async def handle_exec_result(self, ctx: ModalContext, result: Any, value: Any, b
9595
if result is None:
9696
result = value or "No Output!"
9797

98-
if isinstance(result, Message):
98+
elif isinstance(result, Message):
9999
try:
100100
e = debug_embed("Exec", timestamp=result.created_at, url=result.jump_url)
101101
e.description = result.content
@@ -109,13 +109,13 @@ async def handle_exec_result(self, ctx: ModalContext, result: Any, value: Any, b
109109
except Exception:
110110
return await ctx.send(result.jump_url)
111111

112-
if isinstance(result, Embed):
112+
elif isinstance(result, Embed):
113113
return await ctx.send(embeds=[result])
114114

115-
if isinstance(result, File):
115+
elif isinstance(result, File):
116116
return await ctx.send(file=result)
117117

118-
if isinstance(result, Paginator):
118+
elif isinstance(result, Paginator):
119119
return await result.send(ctx)
120120

121121
if hasattr(result, "__iter__"):

interactions/ext/jurigged.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def jurigged_prerun(self, _path: str, cf: CodeFile) -> None:
112112
self.bot.logger.debug(f"Caching {cf.module_name}")
113113
self.command_cache = get_all_commands(cf.module)
114114

115-
def jurigged_postrun(self, _path: str, cf: CodeFile) -> None:
115+
def jurigged_postrun(self, _path: str, cf: CodeFile) -> None: # noqa: C901
116116
"""
117117
Jurigged postrun event.
118118

interactions/ext/prefixed_commands/command.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ def is_subcommand(self) -> bool:
465465
"""Return whether this command is a subcommand or not."""
466466
return bool(self.parent)
467467

468-
def _parse_parameters(self) -> None:
468+
def _parse_parameters(self) -> None: # noqa: C901
469469
"""
470470
Parses the parameters that this command has into a form i.py can use.
471471
@@ -668,7 +668,7 @@ def wrapper(func: Callable) -> Self:
668668

669669
return wrapper
670670

671-
async def call_callback(self, callback: Callable, ctx: "PrefixedContext") -> None:
671+
async def call_callback(self, callback: Callable, ctx: "PrefixedContext") -> None: # noqa: C901
672672
"""
673673
Runs the callback of this command.
674674

interactions/ext/prefixed_commands/manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ async def _handle_ext_unload(self, event: ExtensionUnload) -> None:
243243
self.remove_command(name)
244244

245245
@listen("raw_message_create", is_default_listener=True)
246-
async def _dispatch_prefixed_commands(self, event: RawGatewayEvent) -> None:
246+
async def _dispatch_prefixed_commands(self, event: RawGatewayEvent) -> None: # noqa: C901
247247
"""Determine if a prefixed command is being triggered, and dispatch it."""
248248
# don't waste time processing this if there are no prefixed commands
249249
if not self.commands:

interactions/models/discord/guild.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1664,6 +1664,7 @@ async def ban(
16641664
warn(
16651665
"delete_message_days is deprecated and will be removed in a future update",
16661666
DeprecationWarning,
1667+
stacklevel=2,
16671668
)
16681669
delete_message_seconds = delete_message_days * 3600
16691670
await self._client.http.create_guild_ban(self.id, to_snowflake(user), delete_message_seconds, reason=reason)

0 commit comments

Comments
 (0)