| id | 202 |
|---|---|
| title | Split cmd/mdsmith/main.go into per-subcommand files |
| status | ✅ |
| summary | main.go is 1 306 lines with six handlers over 50 lines. Move each oversized handler to its own per-subcommand file, following the pattern used by kinds.go, metrics.go, and backlinks.go. |
| model | |
| depends-on |
cmd/mdsmith/main.go is 1 306 lines.
Six handlers exceed ~50 lines: runHelp
(81), runFix (71), fixDiscovered
(68), runCheck (62), checkStdin
(61), run (57). The per-subcommand
file pattern is already used by
kinds.go,
metrics.go,
backlinks.go,
and mergedriver.go.
- Create
cmd/mdsmith/check.go; moverunCheck,checkStdin, and helpers. - Create
cmd/mdsmith/fix.go; moverunFix,fixDiscovered, and helpers. - Create
cmd/mdsmith/help.go; moverunHelpand helpers. - Remove the moved functions from
main.go; verify it drops below 700 lines. - Run
go build ./...andgo test ./....
-
cmd/mdsmith/main.gois under 700 lines. - No handler body exceeds ~50 lines.
-
check.go,fix.go,help.goexist undercmd/mdsmith/. -
go build ./...clean. -
go test ./...passes. -
go tool golangci-lint runclean.