Skip to content

refactor(cli[add]) Extract duplicated save-config dispatch helpers #521

@tony

Description

@tony

The no-merge path in add_repo has 3 near-identical JSON/YAML save dispatch blocks (~10 lines each) at lines 844-854, 901-911, 961-970.

The merge and no-merge paths each have duplicated "save workspace label adjustments" blocks in SKIP_PINNED and SKIP_EXISTING branches (lines 662-735 merge, 832-917 no-merge).

Suggested refactor:

  • Extract _save_ordered_config(config_file_path, ordered_items) for the dispatch
  • Extract _save_relabel_adjustments(...) for the label adjustment blocks

Found by multi-model code review (Claude, 1/3 consensus). Findings #3 + #4 combined.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions