scheme: add --json flag to list-presets, --accent flag, drop :accent from preset spec
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 13s
Python / lint-format (pull_request) Successful in 25s
Python / test (pull_request) Successful in 44s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m48s

- list-presets --json outputs structured JSON with variants,
  modes, accents, and default_accent for accent-aware schemes
- --accent flag replaces :accent shorthand in preset string
- Validate --accent against variant's available accents
- resolve_preset returns tuple[str, str] (scheme + variant only)
- Update tests for new signature
This commit is contained in:
2026-05-23 17:42:58 +02:00
parent 2934d863ca
commit 21ed178bbc
3 changed files with 51 additions and 26 deletions
+4 -6
View File
@@ -132,12 +132,10 @@ def list_schemes() -> dict[str, SchemeMeta]:
return dict(SCHEMES)
def resolve_preset(spec: str) -> tuple[str, str, str | None]:
def resolve_preset(spec: str) -> tuple[str, str]:
parts = spec.split(":")
if len(parts) == 3:
return parts[0], parts[1], parts[2]
if len(parts) == 2:
return parts[0], parts[1], None
return parts[0], parts[1]
if len(parts) == 1:
return parts[0], "default", None
raise ValueError(f"Invalid preset spec '{spec}'. Use <scheme>:<variant>[:<accent>]")
return parts[0], "default"
raise ValueError(f"Invalid preset spec '{spec}'. Use <scheme>:<variant>")