Summary
Over 2,400 function-length violations across parser, actionpins, and workflow packages. Functions range from 62 to 492 lines; limit is 60 lines per function.
Packages Affected
- pkg/parser (highest concentration): import_bfs (492L), mcp (253L), ParseMCPConfig (253L), and 100+ others
- pkg/workflow (largest subsystem): compiler_pre_activation_job (486L), compiler_main_job (372L), claude_tools (360L), and 100+ others
- pkg/actionpins: ResolveActionPin (105L)
Top Violations (by line count)
- pkg/parser/import_bfs.go:21 - processImportsFromFrontmatterWithManifestAndSource (492L)
- pkg/workflow/compiler_pre_activation_job.go:20 - buildPreActivationJob (486L)
- pkg/workflow/compiler_main_job.go:26 - buildMainJob (372L)
- pkg/workflow/claude_tools.go:168 - computeAllowedClaudeToolsString (360L)
- pkg/parser/mcp.go:432 - ParseMCPConfig (253L)
Refactoring Strategy
For each function exceeding 60 lines:
- Identify logical segments - Split by distinct concerns or phases
- Extract helpers - Create private helper functions for each segment
- Preserve behavior - No logic changes, only structural refactoring
- Update call sites - Replace inline code with helper calls
- Test validation - Run existing tests to ensure no behavioral changes
Validation
After refactoring batch:
- Run
make golint-custom | grep "lines long" to verify progress
- Run selective tests:
go test -v -run "Test<RelatedName>" ./pkg/<package>/
- Commit with message: "refactor: break up (package) functions exceeding 60-line limit"
Expected Outcome
All functions ≤60 lines; make golint-custom shows zero "lines long" violations in assigned packages.
Generated by 🧌 LintMonster · ● 79.6K · ◷
Summary
Over 2,400 function-length violations across parser, actionpins, and workflow packages. Functions range from 62 to 492 lines; limit is 60 lines per function.
Packages Affected
Top Violations (by line count)
Refactoring Strategy
For each function exceeding 60 lines:
Validation
After refactoring batch:
make golint-custom | grep "lines long"to verify progressgo test -v -run "Test<RelatedName>" ./pkg/<package>/Expected Outcome
All functions ≤60 lines;
make golint-customshows zero "lines long" violations in assigned packages.