Skip to content

Fix config recovery hint and add config utils regression tests#26

Open
shuofengzhang wants to merge 2 commits intolnxpy:mainfrom
shuofengzhang:chore/config-create-hint
Open

Fix config recovery hint and add config utils regression tests#26
shuofengzhang wants to merge 2 commits intolnxpy:mainfrom
shuofengzhang:chore/config-create-hint

Conversation

@shuofengzhang
Copy link
Copy Markdown

What changed

  • Updated read_configs() to load JSON via json.load() with explicit UTF-8 decoding.
  • Fixed the broken-config guidance message to suggest hey config create (the actual command) instead of hey config init.
  • Hardened init_config() to always create the config directory before writing config.json.
  • Added regression tests for:
    • valid config loading,
    • invalid JSON fallback behavior,
    • error hint text including hey config create.

Why

  • The previous recovery hint referenced a non-existent command (hey config init), which could mislead users during config repair.
  • Ensuring directory creation inside init_config() makes config initialization robust even when called directly.
  • New tests lock this behavior in and reduce risk of regressions.

Testing

  • scripts/clone_and_test.sh lnxpy/hey (pass)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant