Skip to content

[lint-monster] refactor: reduce function complexity in workflow and CLI files (2218 findings) #35625

@github-actions

Description

@github-actions

Summary

The custom linter detected 2218 functions across workflow, CLI, and other packages that exceed the 60-line limit. This is the largest category of findings and includes critical refactoring tasks across many modules.

Critical Long Functions (>300 lines)

  • copilot_engine_execution.go::GetExecutionSteps — 491 lines
  • maintenance_workflow_yaml.go::buildMaintenanceWorkflowYAML — 936 lines (LARGEST)
  • mcp_config_custom.go::renderSharedMCPConfig — 502 lines
  • frontmatter_extraction_yaml.go::commentOutProcessedFieldsInOnSection — 599 lines
  • claude_tools.go::computeAllowedClaudeToolsString — 360 lines
  • codex_engine.go::GetExecutionSteps — 331 lines

Affected Areas

This group spans 100+ files including:

  • Engine implementations (claude, copilot, codex, gemini, crush, pi, opencode)
  • AWF helpers and configuration builders
  • Safe output job and step generators
  • Various validators and parsers
  • Workflow and frontmatter handling

Decomposition Strategy

Same approach as compiler group:

  1. Extract logical sections (15-30 lines each) into focused helpers
  2. Use semantic naming (parse*, build*, generate*, validate*, extract*)
  3. Pass dependencies as parameters
  4. Maintain independent testability
  5. Update internal documentation

Validation

Run make golint-custom to verify progress across the entire codebase.

Remediation Approach

Prioritize by file (work in modules):

  1. Critical files: maintenance_workflow_yaml.go (936L), copilot_engine_execution.go (491L), mcp_config_custom.go (502L)
  2. Engine implementations: claude_tools.go, codex_engine.go, copilot_engine_execution.go
  3. Configuration/frontmatter: frontmatter_extraction_yaml.go, awf_helpers.go, cache.go
  4. Safe outputs: compiler_safe_outputs_steps.go, compiler_safe_outputs_job.go
  5. Remaining: alphabetical by file

References

  • See .github/skills/go-linters/SKILL.md for linter details
  • See scratchpad/validation-refactoring.md for decomposition examples

Generated by 🧌 LintMonster · haiku45 105.9K ·

  • expires on Jun 5, 2026, 3:51 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