Skip to content

The agent that grows with you

refactor(hermes_cli): group C — pack short keyword-argument lists

Tekniume1a22b7845fe
diff --git a/hermes_cli/commands_completion.py b/hermes_cli/commands_completion.py
index a68116fd205..3bd19dff054 100644
--- a/hermes_cli/commands_completion.py
+++ b/hermes_cli/commands_completion.py
@@ -233,9 +233,7 @@ def _dir_completions(
break
suffix = "/" if is_dir else ""
yield Completion(
- text_for(full_path) + suffix,
- start_position=-len(word),
- display=entry + suffix,
+ text_for(full_path) + suffix, start_position=-len(word), display=entry + suffix,
display_meta="dir" if is_dir else _file_size_label(full_path))
count += 1
@@ -398,8 +396,7 @@ class SlashCommandCompleter(Completer):
expanded = "./"
# `@folder:` = dirs only, `@file:` = files only (else `@folder:` lists dotfiles).
yield from _dir_completions(
- expanded, word, limit,
- lambda fp: f"{prefix}{os.path.relpath(fp)}",
+ expanded, word, limit, lambda fp: f"{prefix}{os.path.relpath(fp)}",
want_dir=(prefix == "@folder:"))
return
@@ -489,10 +486,8 @@ class SlashCommandCompleter(Completer):
def _cmd_completion(cmd_name: str, meta: str):
return Completion(
- self._completion_text(cmd_name, word),
- start_position=-len(word),
- display=f"/{cmd_name}",
- display_meta=meta)
+ self._completion_text(cmd_name, word), start_position=-len(word),
+ display=f"/{cmd_name}", display_meta=meta)
for cmd, desc in COMMANDS.items():
if self._command_allowed(cmd) and cmd[1:].startswith(word):
diff --git a/hermes_cli/console_engine.py b/hermes_cli/console_engine.py
index 13fb29a6a8d..448045e8320 100644
--- a/hermes_cli/console_engine.py
+++ b/hermes_cli/console_engine.py
@@ -352,12 +352,8 @@ def _register_command_family(
return _dispatch(surface, root, fixed, args, namespace_update)
engine.register(
- full_path,
- usage,
- summaries.get(full_path) or f"Run `hermes {usage}`.",
- handler,
- mutating=mutating,
- confirmation=f"Run `hermes {usage}`?")
+ full_path, usage, summaries.get(full_path) or f"Run `hermes {usage}`.", handler,
+ mutating=mutating, confirmation=f"Run `hermes {usage}`?")
_BLOCKED_TOP = frozenset(