mirror of
https://github.com/safishamsi/graphify.git
synced 2026-10-25 08:11:54 +00:00
fix(cli): derive the --help platform list from _PLATFORM_CONFIG + add a drift guard (#4655)
#4655 added amp/copilot/kilo/kimi to the hand-maintained --help install line but still omitted antigravity-windows, so it disagreed with _print_install_usage. Derive the list from the same [*_PLATFORM_CONFIG, "gemini", "cursor"] expression the install usage uses so the two cannot drift, and add test_help_lists_every_install_platform to catch any future platform that is not advertised. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
dd45dfc2b0
commit
de35292406
2 files changed
+30
-1
No files matched your search
@@ -861,7 +861,11 @@ def _run_cli() -> None:
|
||||
print("Usage: graphify <command>")
|
||||
print()
|
||||
print("Commands:")
|
||||
print(" install [--platform P] copy skill to platform config dir (claude|windows|codebuddy|codex|opencode|aider|amp|agents|claw|droid|trae|trae-cn|gemini|cursor|antigravity|hermes|kiro|pi|devin|copilot|kilo|kimi)")
|
||||
# Derive the list from the same source as `graphify install` usage
|
||||
# (_print_install_usage) so the two can never drift apart, rather than
|
||||
# hand-maintaining it (amp, copilot, antigravity-windows had been missed, #4655).
|
||||
_platform_values = "|".join([*_PLATFORM_CONFIG, "gemini", "cursor"])
|
||||
print(f" install [--platform P] copy skill to platform config dir ({_platform_values})")
|
||||
print(" uninstall remove graphify from all detected platforms in one shot")
|
||||
print(" --purge also delete graphify-out/ directory")
|
||||
print(" path \"A\" \"B\" shortest path between two nodes in graph.json")
|
||||
|
||||
@@ -39,3 +39,28 @@ def test_help_lists_prs_provider_and_export_formats():
|
||||
# Silent hook internals — deliberately excluded from user-facing help.
|
||||
assert "hook-check" not in out
|
||||
assert "hook-guard" not in out
|
||||
|
||||
|
||||
def test_help_lists_every_install_platform():
|
||||
"""#4655: the `install [--platform P]` line must advertise every accepted
|
||||
`--platform` value. It is derived from the same source as `graphify install`
|
||||
usage (`[*_PLATFORM_CONFIG, "gemini", "cursor"]`), so this guards against the
|
||||
list silently drifting again (amp, copilot, kilo, kimi, antigravity-windows
|
||||
had all gone missing)."""
|
||||
import re
|
||||
|
||||
from graphify.install import _PLATFORM_CONFIG
|
||||
|
||||
r = subprocess.run(
|
||||
[PYTHON, "-m", "graphify", "--help"],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
)
|
||||
assert r.returncode == 0, f"--help should exit 0: {r.stderr}"
|
||||
m = re.search(r"install \[--platform P\][^(]*\(([^)]*)\)", r.stdout)
|
||||
assert m, "could not find the install --platform list in `graphify --help`"
|
||||
listed = set(m.group(1).split("|"))
|
||||
for platform_name in [*_PLATFORM_CONFIG, "gemini", "cursor"]:
|
||||
assert platform_name in listed, (
|
||||
f"`graphify --help` must list the --platform value {platform_name!r} (#4655)"
|
||||
)
|
||||
Reference in new issue
Block a user