Skip to content

The agent that grows with you

refactor(hermes_cli): npm_engine/onepassword — fold trivial intermediates

Teknium13d23e450cc4
diff --git a/hermes_cli/npm_engine.py b/hermes_cli/npm_engine.py
index 5a5ea34e003..b15b34fcc47 100644
--- a/hermes_cli/npm_engine.py
+++ b/hermes_cli/npm_engine.py
@@ -93,9 +93,7 @@ def _repo_npm_range() -> str | None:
except (OSError, ValueError):
return None
engines = data.get("engines")
- if not isinstance(engines, dict):
- return None
- value = engines.get("npm")
+ value = engines.get("npm") if isinstance(engines, dict) else None
return str(value).strip() if value else None
diff --git a/hermes_cli/onepassword_secrets_cli.py b/hermes_cli/onepassword_secrets_cli.py
index 3cdd147d92e..6d70bcd9414 100644
--- a/hermes_cli/onepassword_secrets_cli.py
+++ b/hermes_cli/onepassword_secrets_cli.py
@@ -392,5 +392,4 @@ def _op_whoami(binary: Path, account: str, *, token_value: str = "") -> Optional
return None
if res.returncode != 0:
return None
- out = (res.stdout or "").strip()
- return out.replace("\n", " ")[:120] or "authenticated"
+ return (res.stdout or "").strip().replace("\n", " ")[:120] or "authenticated"