gabriel / muse public
refactor BREAKING dev
AI Agent gabriel · 156 days ago · Apr 19, 2026 · Diff

refactor: standardize --format→--json/-j for branch, checkout, commit, merge + guard

Replace dual --format/-f + --json (store_const) pattern with single canonical --json/-j (store_true, dest=json_out) across branch, checkout, commit, merge, and the shared require_clean_workdir guard.

All internal helpers updated (fmt: str → json_out: bool). TDD: parser-level flag tests added for all four commands.

sha256:fd60cc2af668a39c5c2223e82200b3042c55561d7450f5e9ac9bd1a561a2d3d7 sha
+15 ~28 −12 symbols
sha256:ac6b19b593df890a1f7d830225491d5887e55324ce78c6e32d13c836926f794b snapshot
+15
symbols added
~28
symbols modified
−12
symbols removed
0
dead code introduced
Semantic Changes 55 symbols
~ muse/cli/commands/branch.py .py 2 symbols modified
~ muse/cli/commands/commit.py .py 2 symbols modified
~ muse/cli/guard.py .py 1 symbol modified
~ tests/test_cmd_branch.py .py 3 symbols added, 3 symbols removed, 1 symbol modified
test_default_fmt_is_text method method test_default_fmt_is_text L96–98
test_format_json_flag method method test_format_json_flag L104–106
test_json_flag_sets_fmt method method test_json_flag_sets_fmt L100–102
+ test_default_json_out_is_false method method test_default_json_out_is_false L96–98
+ test_j_shorthand_sets_json_out method method test_j_shorthand_sets_json_out L104–106
+ test_json_flag_sets_json_out method method test_json_flag_sets_json_out L100–102
~ tests/test_cmd_checkout.py .py 4 symbols added, 6 symbols removed, 6 symbols modified
test_default_fmt_is_text method method test_default_fmt_is_text L101–103
test_format_json_flag method method test_format_json_flag L109–111
test_json_flag_sets_fmt method method test_json_flag_sets_fmt L105–107
test_ansi_in_format_sanitized method method test_ansi_in_format_sanitized L623–625
test_unknown_format_error_to_stderr method method test_unknown_format_error_to_stderr L593–595
test_unknown_format_exits_1 method method test_unknown_format_exits_1 L589–591
+ test_default_json_out_is_false method method test_default_json_out_is_false L101–103
+ test_j_shorthand_sets_json_out method method test_j_shorthand_sets_json_out L109–111
+ test_json_flag_sets_json_out method method test_json_flag_sets_json_out L105–107
+ test_unknown_flag_exits_nonzero method method test_unknown_flag_exits_nonzero L589–591
~ tests/test_cmd_commit.py .py 3 symbols added, 3 symbols removed, 3 symbols modified
test_format_text_default method method test_format_text_default L108–110
test_unknown_format_exits_1 method method test_unknown_format_exits_1 L341–343
test_unknown_format_sanitized_in_error method method test_unknown_format_sanitized_in_error L345–348
+ test_default_json_out_is_false method method test_default_json_out_is_false L112–114
+ test_j_shorthand method method test_j_shorthand L108–110
+ test_unknown_flag_exits_nonzero method method test_unknown_flag_exits_nonzero L345–347
~ tests/test_cmd_merge.py .py 5 symbols added, 4 symbols modified
+ TestRegisterFlags class class TestRegisterFlags L94–113
+ _parse method method _parse L95–101
+ test_default_json_out_is_false method method test_default_json_out_is_false L103–105
+ test_j_shorthand_sets_json_out method method test_j_shorthand_sets_json_out L111–113
+ test_json_flag_sets_json_out method method test_json_flag_sets_json_out L107–109
← Older Oldest on dev
All commits
Newer → Latest on dev

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:fd60cc2af668a39c5c2223e82200b3042c55561d7450f5e9ac9bd1a561a2d3d7 --body "your comment"