Skip to content

[lint-monster] Fix: Refactor oversized functions in parser and workflow packages (2380 violations) #33680

@github-actions

Description

@github-actions

Function Length Violations

Category: Code complexity / function length
Scope: pkg/parser/ and pkg/workflow/
Finding Count: ~2380 functions exceeding 60-line limit
Limit: 60 lines per function

Representative Issues

pkg/parser/ (34 functions)

  1. processImportsFromFrontmatterWithManifestAndSource() - 492 lines
  2. ParseMCPConfig() - 253 lines
  3. processBuiltinMCPTool() - 172 lines
  4. ScatterSchedule() - 441 lines
  5. And 30 more functions in: frontmatter_.go, import_.go, mcp.go, remote_fetch.go, etc.

pkg/workflow/ (2346 functions)

  1. GetExecutionSteps() in claude_engine.go - 373 lines
  2. buildMainJob() - 372 lines
  3. setupEngineAndImports() - 391 lines
  4. computeAllowedClaudeToolsString() - 360 lines
  5. buildPreActivationJob() - 486 lines
  6. And 2341 more functions across all workflow compilation files

Remediation Checklist

  • Extract helper functions: Break each oversized function into smaller, focused subfunctions (10-20 lines each)
  • Preserve behavior: Ensure extracted functions maintain the exact same logic and output
  • Use meaningful names: Naming should clarify the extracted responsibility
  • Update comments: Move/add comments explaining the refactored structure
  • Run validation: Execute make golint-custom to verify all violations are fixed
  • Test selective: Run go test -v -run TestCompile ./pkg/workflow/ for workflow tests
  • Commit with message: Include issue reference in commit message

Expected Outcome

All functions in pkg/parser/ and pkg/workflow/ should be ≤60 lines. The make golint-custom linter should report zero violations in this category.

Priority Guidance

  1. Start with the most egregious offenders (400+ lines)
  2. Work through files in dependency order: remote_fetch → parser → workflow
  3. Focus on functions with many responsibilities (candidates for easy extraction)
  4. Leave test functions for later (lower priority)

Relevant Skills

See skills/developer/SKILL.md for validation architecture and refactoring patterns.


Created by: LintMonster
Report: Daily custom lint scan

Generated by 🧌 LintMonster · ● 601.6K ·

  • expires on May 28, 2026, 3:50 AM UTC

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions