refactor(cmd): split main.go into cohesive files (under size gate) - #437
Merged
Conversation
cmd/stem/main.go was 1532 lines, exceeding the project >1200-line red flag. Split along natural functional seams into six new files in the same package main — zero logic changes, zero renames, verbatim moves: - cmd_reflect.go reflect subcommand + stats loop + helpers - cmd_testmaster.go test subcommand + flag parsing + license check - cmd_test_runners.go individual RFC-2544/Y.1564 runners + result printing - cmd_web.go web subcommand - cmd_tui.go tui subcommand (reflect + testmaster modes) - cmd_help.go help / tutorial / glossary / list-tests subcommands - cmd_license.go license subcommand + status display main.go now holds only: constants, func main(), dispatchSubcommand(), printVersion(), printUsage(). 263 lines. Note: cmd_test.go was renamed to cmd_testmaster.go because Go treats files ending in _test.go as test files, which hid the package symbols from the non-test build.
Contributor
License Compliance ReportAll dependencies pass license compliance checksGo Dependencies
npm DependenciesSee full report in workflow artifacts Allowed Licenses: MIT, Apache-2.0, BSD-*, ISC, CC0-1.0, MPL-2.0 |
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
cmd/stem/main.gowas 1532 lines — over the project >1200-line red flag. Split verbatim along functional seams into six new files inpackage main(no new packages, no import changes elsewhere, no logic changes).cmd_test.gowas renamed tocmd_testmaster.gobecause Go treats*_test.gofiles as test files, which hid the package symbols from the non-test build.Split
main.gofunc main(),dispatchSubcommand(),printVersion(),printUsage()cmd_reflect.goreflectCmd,reflectorStatsLoop, flag parsing, license check, config buildcmd_testmaster.gotestCmd,parseTestFlags,createTestConfig,parseFrameSizes, license checkcmd_test_runners.goprintTestResult,printCSVResultscmd_web.gowebCmdcmd_tui.gotuiCmd,tuiReflectMode,tuiTestModecmd_help.gohelpCmd,tutorialCmd,glossaryCmd,listTestsCmdcmd_license.golicenseCmd,displayLicenseStatusValidation
Notes
cmd_underscore convention established bycmd_install_ca.go.