Repository navigation
Closed
Labels
Description
[lint-monster] Function Length Refactoring Tracking
Status
Current Issue Count: 636 long functions
Last Updated: 2026-06-05
Overview
This is the authoritative tracking issue for the function-length custom linter finding. The linter enforces a 60-line limit per function across pkg/workflow/ and pkg/cli/.
Directories Affected
| Path | Count | Status |
|---|---|---|
| pkg/workflow/ | ~600 | Not started |
| pkg/cli/ | ~36 | Partial (1 issue open: #36947) |
Largest Functions Requiring Refactoring
Critical (500+ lines)
buildMaintenanceWorkflowYAML(936 lines) — pkg/workflow/maintenance_workflow_yaml.go:33commentOutProcessedFieldsInOnSection(625 lines) — pkg/workflow/frontmatter_extraction_yaml.go:107buildConclusionJob(592 lines) — pkg/workflow/notify_comment.go:28buildPreActivationJob(489 lines) — pkg/workflow/compiler_pre_activation_job.go:20
Very Large (200-400 lines)
GetExecutionSteps(382 lines) — pkg/workflow/claude_engine.go:138GetExecutionSteps(350 lines) — pkg/workflow/engine.go:216GetExecutionSteps(338 lines) — pkg/workflow/codex_engine.go:161buildMainJob(385 lines) — pkg/workflow/compiler_main_job.go:26
Refactoring Strategy
Extract Logical Sub-Functions
- Identify distinct phases or operations within each function
- Extract into private helper functions prefixed with appropriate naming
- Preserve function signatures (no breaking changes)
Use Local Structs for Intermediate Results
- Group related intermediate values into temporary structs
- Reduces parameter passing between sub-functions
Options Struct Pattern
- For complex configuration building (many parameters)
- Reference:
.github/skills/developer/SKILL.mdcode organization guidelines
Validation Workflow
After each refactoring:
make golint-custom # Verify function passes length check
make build # Ensure compilation
make fmt # Format codeNext Steps
- Slice 1: Refactor 5 largest functions (500+ lines)
- Slice 2: Refactor 20 very large functions (200-400 lines)
- Slice 3: Remaining medium functions (60-200 lines)
Related Issues
- [deep-report] Extract an options struct for computeModelEffectiveTokensWithWeights (9 params, limit 8) #36947 -
computeModelEffectiveTokensWithWeights(parameters refactor)
Generated by 🧌 LintMonster · 177 AIC · ◷
- expires on Jun 12, 2026, 3:50 AM UTC
Reacted by Copilot
Activity
github-actions commentedon Jun 6, 2026
🍪 Issue Monster selected this for Copilot
I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.
If assignment succeeds, the Copilot coding agent will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪