Conversation
5f07757 to
1a5f794
Compare
There was a problem hiding this comment.
Pull request overview
Adds sc show subcommands to the branching CLI to display repository/project information (branch status, gitflow config, logs, groups), and wires them into the SCBranching command dispatcher.
Changes:
- Introduces a new
showCLI group withbranch,repo_flow_config,log,tag,tags, andgroupsubcommands. - Adds new
ShowBranch,ShowRepoFlowConfig,ShowLog, andGroupShowcommand implementations and exposes them viaSCBranching. - Fixes a typo in tag listing output (“mainfest” → “manifest”).
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/sc/branching_cli.py |
Adds sc show CLI group and subcommands; minor decorator change for tag group. |
src/sc/branching/commands/show.py |
New command implementations for sc show branch, repo_flow_config, and log. |
src/sc/branching/commands/group.py |
New command implementation for sc show group (list groups or show group info). |
src/sc/branching/branching.py |
Wires new show/group commands into SCBranching and dispatching. |
src/sc/branching/commands/tag.py |
Fixes “mainfest” typo in log output. |
src/sc/branching/commands/common.py |
No functional change (formatting-only in the diff). |
Comments suppressed due to low confidence (11)
src/sc/branching/commands/show.py:82
- Grammar: “must be ran” should be “must be run”.
logger.error("`sc show repo_flow_config` must be ran inside a repo project!")
src/sc/branching_cli.py:298
@cli.groupis used without parentheses here, while every other CLI group in this file uses@cli.group(). For consistency (and to avoid any ambiguity about Click decorator behavior), consider switching back to@cli.group()unless there’s a specific reason not to.
@cli.group()
src/sc/branching_cli.py:361
- This
def tag(...)under theshowgroup reuses the global nametag, which already refers to the top-leveltagcommand group defined above. Even though Click has already registered the group, this shadowing is confusing and makes future refactors error-prone. Rename the function (e.g.,show_tag) to avoid clobbering thetaggroup symbol.
@show.command()
@click.argument("tag")
def tag(tag):
"""Show information about a tag."""
SCBranching.tag_show(tag)
src/sc/branching/commands/show.py:83
run_git_command()logs an error but then returns successfully. This means runningsc show repo_flow_configinside a normal git repo will exit with status 0 even though it’s unsupported. Align with the baseCommandbehavior by exiting non-zero (e.g.,sys.exit(1)) or raising an exception after logging.
def run_git_command(self):
logger.error("`sc show repo_flow_config` must be ran inside a repo project!")
src/sc/branching/commands/group.py:80
- The Rich-markup escaping here looks inconsistent with
ShowBranchand likely renders without a closing](only the opening[is escaped/printed). Consider matching theShowBranchpattern so the lock status displays as[NORMAL](or similar) consistently.
logger.info(
f"Lock Status: [bold yellow]\[{proj.lock_status or 'NORMAL'}][/]",
extra={"markup": True}
)
src/sc/branching/commands/group.py:21
Pathandsysare imported here but not used in this module. Removing unused imports will avoid linter warnings and keep the module tidy.
from pathlib import Path
import subprocess
import sys
src/sc/branching/commands/group.py:35
- Grammar: “must be ran” should be “must be run”.
logger.error("`sc show group` must be ran inside a repo project!")
src/sc/branching_cli.py:355
- The
sc show logcommand has no docstring, so Click will not have a helpful--helpdescription for this subcommand (unlike the othersc showsubcommands here). Add a short docstring describing what it outputs.
def log():
SCBranching.show_log()
src/sc/branching/commands/group.py:36
run_git_command()logs an error but then returns successfully. This makessc show groupinside a normal git repo appear to succeed (exit code 0) even though it’s unsupported. Align with the baseCommandbehavior by exiting non-zero (e.g.,sys.exit(1)) or raising an exception after logging.
def run_git_command(self):
logger.error("`sc show group` must be ran inside a repo project!")
src/sc/branching/commands/show.py:66
url = next(remote.urls)can raiseStopIterationif a remote exists but has no configured URLs. Use a safe default (e.g.,next(remote.urls, None)) and handle the missing-URL case sosc show branchdoesn’t crash on misconfigured repos.
if repo.remotes:
remote = repo.remotes[0]
url = next(remote.urls)
remote_status = f"{remote.name} {url}"
src/sc/branching/commands/group.py:87
url = next(remote.urls)can raiseStopIterationif a remote exists but has no configured URLs. Use a safe default (e.g.,next(remote.urls, None)) and handle the missing-URL case sosc show groupdoesn’t crash on misconfigured repos.
if repo.remotes:
remote = repo.remotes[0]
url = next(remote.urls)
remote_status = f"{remote.name} {url}"
else:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1a5f794 to
4d3f814
Compare
Closes #35
Implement sc show functionality:
sc show branch
sc show tag
sc show tags
sc show repo_flow_config
sc show group
sc show log
We already added
sc show tagandsc show tagsassc tag showandsc tag listin a previous ticket and therefore we are just piping these commands to those functions.