refactor(cli[add]) Extract duplicated save-config dispatch helpers#530
Open
refactor(cli[add]) Extract duplicated save-config dispatch helpers#530
Conversation
Closes #521 why: merge/no-merge paths in add_repo() duplicate ~200 lines of logic. what: - Extract _save_config_or_log_error() for try/except/log pattern - Extract _extract_current_url() for URL derivation from config entries - Extract _handle_skip_action() for SKIP_PINNED/SKIP_EXISTING branches - Both code paths now share the same dispatch helpers
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #530 +/- ##
==========================================
+ Coverage 83.51% 84.04% +0.53%
==========================================
Files 29 29
Lines 3645 3635 -10
Branches 726 722 -4
==========================================
+ Hits 3044 3055 +11
+ Misses 386 364 -22
- Partials 215 216 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Member
Author
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #521
_save_config_or_log_error()for the try/except/log.exception pattern (used 4x)_extract_current_url()for deriving display URLs from config entries (duplicated in merge/no-merge paths)_handle_skip_action()for SKIP_PINNED/SKIP_EXISTING branches (~30 lines each, duplicated)Test plan
uv run ruff check .— all checks passeduv run ruff format .— no changes neededuv run mypy— no issues founduv run py.test -vvv— 1175 passed