Skip to content

feat/scan#42

Merged
hugoh merged 11 commits into
mainfrom
feat/scan
Jun 28, 2026
Merged

feat/scan#42
hugoh merged 11 commits into
mainfrom
feat/scan

Conversation

@hugoh

@hugoh hugoh commented Jun 28, 2026

Copy link
Copy Markdown
Owner
  • fix(tui): remove "new model:" prefix from user-facing errors
  • fix(cmd): include group name in repo-add success message
  • fix(completion): fall back to file completion for repo add and scan
  • feat(scan): replace flat scan with add/list subcommands
  • feat(scan): add --group to scan list to bulk-assign tracked repos
  • refactor(scan): extract loadScanConfig and collectRepoPaths helpers
  • refactor: deduplicate completer factory and mode-toggle logic
  • chore(deps): upgrade
  • refactor: style

hugoh and others added 9 commits June 28, 2026 10:31
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- `repo scan add`: replaces old scan; adds --pattern (glob filter on
  basename) and --confirm/-i (interactive per-repo y/N prompt via
  bubbletea); removes --dry-run; silently skips already-tracked repos
- `repo scan list`: shows discovered repos with tracked/untracked
  status using the same RenderTable layout as repo ls; supports
  --tracked and --untracked filters
- `ui.Confirm`: new bubbletea-backed y/N prompt in internal/ui

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
`repo scan list -p <pattern> --tracked -g <group> <dir>` assigns all
already-tracked repos matching the pattern to the given group, closing
the gap where `scan add -g` skips repos that are already in config.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Both action functions shared identical arg-check/config-load boilerplate
and filepath.Abs/scanForRepos loop. Extracting helpers eliminates the
duplication and reduces the two action functions to their distinct logic.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
cmd/completions.go: extract makeCompleter variadic factory — the three
completer functions shared identical config-load/loop boilerplate and
now each reduce to a one-liner.

internal/tui/selection.go: extract toggleMode helper — handleSelectToggle
and handleSingleToggle shared 29 identical lines for cursor save/restore
and table restyle; the only difference was target mode and whether to
snapshot m.selected.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@deepsource-io

deepsource-io Bot commented Jun 28, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in 0d1f3a7...a9f7178 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
Go Jun 28, 2026 9:30p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@codecov

codecov Bot commented Jun 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.21782% with 44 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.52%. Comparing base (0d1f3a7) to head (a9f7178).

Files with missing lines Patch % Lines
cmd/scan.go 86.16% 12 Missing and 10 partials ⚠️
internal/ui/confirm.go 0.00% 19 Missing ⚠️
internal/tui/model.go 0.00% 2 Missing ⚠️
cmd/repo.go 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #42      +/-   ##
==========================================
- Coverage   89.17%   88.52%   -0.66%     
==========================================
  Files          32       33       +1     
  Lines        3539     3668     +129     
==========================================
+ Hits         3156     3247      +91     
- Misses        293      322      +29     
- Partials       90       99       +9     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread internal/ui/confirm.go
func (m confirmModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
if key, ok := msg.(tea.KeyMsg); ok {
if key.String() == "y" || key.String() == "Y" {
m.confirmed = true

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suspicious assignment to a by-value method receiver


A method that modifies its receiver value can have undesired behavior. The
modification can also be the root of a bug because the actual value receiver
could be a copy of that used at the calling site. This rule warns when a method
modifies its receiver.

Comment thread internal/ui/confirm.go Outdated
confirmed bool
}

func (confirmModel) Init() tea.Cmd { return nil }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type "confirmModel" has both value and pointer receivers


(Go's FAQ)[https://go.dev/doc/faq#methods_on_values_or_pointers] recommends
that method receivers should be consistent. If some of the methods of the type
must have pointer receivers, the rest should too, so the method set is
consistent regardless of how the type is used. This is because value and
pointer receivers have different
method sets.

Comment thread internal/ui/confirm.go

func (confirmModel) Init() tea.Cmd { return nil }

func (m *confirmModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type "confirmModel" has both value and pointer receivers


(Go's FAQ)[https://go.dev/doc/faq#methods_on_values_or_pointers] recommends
that method receivers should be consistent. If some of the methods of the type
must have pointer receivers, the rest should too, so the method set is
consistent regardless of how the type is used. This is because value and
pointer receivers have different
method sets.

Comment thread internal/ui/confirm.go
return m, nil
}

func (m *confirmModel) View() tea.View {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type "confirmModel" has both value and pointer receivers


(Go's FAQ)[https://go.dev/doc/faq#methods_on_values_or_pointers] recommends
that method receivers should be consistent. If some of the methods of the type
must have pointer receivers, the rest should too, so the method set is
consistent regardless of how the type is used. This is because value and
pointer receivers have different
method sets.

@hugoh hugoh merged commit e8e4148 into main Jun 28, 2026
6 of 7 checks passed
@hugoh hugoh deleted the feat/scan branch June 28, 2026 21:32
@sonarqubecloud

Copy link
Copy Markdown

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