From 83f23d131d7936027d739c2cd3882a1e1e180804 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 23 May 2023 02:50:08 +0000 Subject: [PATCH 1/2] ci: weekly check. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/charliermarsh/ruff-pre-commit: v0.0.261 → v0.0.269](https://github.com/charliermarsh/ruff-pre-commit/compare/v0.0.261...v0.0.269) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fcbe0c9db..b051c2178 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,7 +30,7 @@ repos: - id: check-merge-conflict name: Merge Conflicts - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: 'v0.0.261' + rev: 'v0.0.269' hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] From e180e5610ff602a309c028b1d99258b4a424374a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 23 May 2023 02:50:22 +0000 Subject: [PATCH 2/2] ci: correct from checks. --- interactions/client/client.py | 2 +- interactions/ext/debug_extension/utils.py | 2 +- interactions/ext/prefixed_commands/command.py | 4 ++-- interactions/models/internal/application_commands.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/interactions/client/client.py b/interactions/client/client.py index 6c261ed34..4a029deb8 100644 --- a/interactions/client/client.py +++ b/interactions/client/client.py @@ -1801,7 +1801,7 @@ async def _dispatch_interaction(self, event: RawGatewayEvent) -> None: # noqa: elif autocomplete := self._global_autocompletes.get(str(auto_opt.name)): callback = autocomplete else: - raise ValueError(f"Autocomplete callback for {str(auto_opt.name)} not found") + raise ValueError(f"Autocomplete callback for {auto_opt.name!s} not found") await self.__dispatch_interaction( ctx=ctx, diff --git a/interactions/ext/debug_extension/utils.py b/interactions/ext/debug_extension/utils.py index 4f677707d..e725102c6 100644 --- a/interactions/ext/debug_extension/utils.py +++ b/interactions/ext/debug_extension/utils.py @@ -112,7 +112,7 @@ def _make_data_line( if isinstance(aligns, str): aligns = [aligns for _ in column_widths] - line = (f"{str(value): {align}{width}}" for width, align, value in zip(column_widths, aligns, line, strict=False)) + line = (f"{value!s: {align}{width}}" for width, align, value in zip(column_widths, aligns, line, strict=False)) return f"{left_char}{f'{middle_char}'.join(line)}{right_char}" diff --git a/interactions/ext/prefixed_commands/command.py b/interactions/ext/prefixed_commands/command.py index f2b323354..de878b31a 100644 --- a/interactions/ext/prefixed_commands/command.py +++ b/interactions/ext/prefixed_commands/command.py @@ -253,7 +253,7 @@ def _greedy_parse(greedy: Greedy, param: inspect.Parameter) -> Any: args = typing.get_args(arg) if len(args) > 2 or NoneType not in args: - raise ValueError(f"Greedy[{repr(arg)}] is invalid.") + raise ValueError(f"Greedy[{arg!r}] is invalid.") arg = args[0] default = None @@ -317,7 +317,7 @@ async def _greedy_convert( if param.default: greedy_args = param.default # im sorry, typehinters else: - raise BadArgument(f"Failed to find any arguments for {repr(param.type)}.") + raise BadArgument(f"Failed to find any arguments for {param.type!r}.") return greedy_args, broke_off diff --git a/interactions/models/internal/application_commands.py b/interactions/models/internal/application_commands.py index 542a00d75..e89aa1ae0 100644 --- a/interactions/models/internal/application_commands.py +++ b/interactions/models/internal/application_commands.py @@ -1363,7 +1363,7 @@ def squash_subcommand(subcommands: List) -> Dict: if any(str(c.description) not in (str(base_description), "No Description Set") for c in cmd_list): client.logger.warning( - f"Conflicting descriptions found in `{cmd_list[0].name}` subcommands; `{str(base_description)}` will be used" + f"Conflicting descriptions found in `{cmd_list[0].name}` subcommands; `{base_description!s}` will be used" ) if any(c.default_member_permissions != cmd_list[0].default_member_permissions for c in cmd_list): raise ValueError(f"Conflicting `default_member_permissions` values found in `{cmd_list[0].name}`")