refactor(cmd/mdsmith): move list-query subcommand logic into query.go - #809
Draft
jeduden wants to merge 2 commits into
Draft
refactor(cmd/mdsmith): move list-query subcommand logic into query.go#809jeduden wants to merge 2 commits into
jeduden wants to merge 2 commits into
Conversation
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 Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
parseQueryFlags,runQuery,queryFiles,readFrontMatterRaw, andqueryOptionsout ofcmd/mdsmith/main.gointo a newcmd/mdsmith/query.go, keepingmain.goas dispatch-and-glue.main_unit_test.gointo a newcmd/mdsmith/query_unit_test.go, following theinit_unit_test.goprecedent.internal/queryandinternal/yamlutilimports frommain.go.plan/2608021915_arch-fix-query-subcommand-placement.mdto✅and regenerate thePLAN.mdstatus table.No behaviour change. This is the same move the 2026-07-19 audit applied for the
initsubcommand.Test plan
go build ./...go test ./cmd/mdsmith/...go tool -modfile=tools/go.mod golangci-lint run ./cmd/mdsmith/...— 0 issuesmdsmith check .— 0 failures/code-review xhighrounds — rounds 1 & 2 found 0 issues; round 3 flagged a stalePLAN.mdtable 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