Skip to content

refactor(cmd/mdsmith): move list-query subcommand logic into query.go - #809

Draft
jeduden wants to merge 2 commits into
mainfrom
claude/youthful-knuth-fq5wwx
Draft

refactor(cmd/mdsmith): move list-query subcommand logic into query.go#809
jeduden wants to merge 2 commits into
mainfrom
claude/youthful-knuth-fq5wwx

Conversation

@jeduden

@jeduden jeduden commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • Move parseQueryFlags, runQuery, queryFiles, readFrontMatterRaw, and queryOptions out of cmd/mdsmith/main.go into a new cmd/mdsmith/query.go, keeping main.go as dispatch-and-glue.
  • Move the 19 corresponding unit tests from main_unit_test.go into a new cmd/mdsmith/query_unit_test.go, following the init_unit_test.go precedent.
  • Remove the now-unused internal/query and internal/yamlutil imports from main.go.
  • Update plan/2608021915_arch-fix-query-subcommand-placement.md to and regenerate the PLAN.md status table.

No behaviour change. This is the same move the 2026-07-19 audit applied for the init subcommand.

Test plan

  • go build ./...
  • go test ./cmd/mdsmith/...
  • go tool -modfile=tools/go.mod golangci-lint run ./cmd/mdsmith/... — 0 issues
  • mdsmith check . — 0 failures
  • 3 × /code-review xhigh rounds — rounds 1 & 2 found 0 issues; round 3 flagged a stale PLAN.md table entry (fixed in the second commit) and 4 pre-existing issues in unrelated files (externallink/probe_net.go, duplicatedcontent/rule.go, astutil/astutil.go, noduplicateheadings/rule.go) that are out of scope for this pure-refactor PR.

Closes plan/2608021915.


Generated by Claude Code

claude added 2 commits August 16, 2026 22:36
Move parseQueryFlags, runQuery, queryFiles, readFrontMatterRaw, and
queryOptions from main.go into a new cmd/mdsmith/query.go, matching the
pattern already used for backlinks.go and init.go. Move their unit tests
from main_unit_test.go into a new query_unit_test.go.

No behaviour change. Closes plan/2608021915.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KcvH2rHLjDWJ4f1HWAePjt
…lete

Run mdsmith fix PLAN.md to sync the generated status table after marking
plan/2608021915_arch-fix-query-subcommand-placement.md as complete.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KcvH2rHLjDWJ4f1HWAePjt
@codecov

codecov Bot commented Aug 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.73%. Comparing base (b706d76) to head (deb55e1).

Additional details and impacted files
Components Coverage Δ
Go 98.72% <100.00%> (ø)
TypeScript 99.54% <ø> (ø)

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants