Skip to content

[lint-monster] [LintMonster] Fix Function Length Violations (2408 findings) #34357

@github-actions

Description

@github-actions

Overview

Daily lint scan identified 2408 functions exceeding 60-line limit (max 60 lines per custom linter).

Assignment Summary

  • Category: Function complexity / cyclomatic complexity
  • Primary Scope: pkg/workflow/ subdirectory (~2400 findings)
  • Secondary Scope: pkg/cli/, pkg/actionpins/, others (~8 findings)
  • Rule: Custom linter limit is 60 lines per function; violations suggest breaking into smaller helper functions

Representative Violations

Top 5 by excess lines:

  1. pkg/workflow/claude_tools.go:168 - computeAllowedClaudeToolsString() is 360 lines (300 over limit)
  2. pkg/workflow/compiler_orchestrator_engine.go:35 - setupEngineAndImports() is 391 lines (331 over limit)
  3. pkg/workflow/compiler_pre_activation_job.go:20 - buildPreActivationJob() is 486 lines (426 over limit)
  4. pkg/workflow/compiler_main_job.go:26 - buildMainJob() is 374 lines (314 over limit)
  5. pkg/workflow/copilot_engine_execution.go:41 - GetExecutionSteps() is 491 lines (431 over limit)

Full list: lint-diagnostics.txt

Remediation Strategy

Skill Guidance: Use .github/skills/developer/SKILL.md — validate pkg/validation split strategy (refactoring limits 100–200 lines/validator, 300 line hard limit)

For each function:

  1. Extract logical sub-blocks into private helper functions
  2. Aim for 50–70 lines per function after refactoring
  3. Validate with make golint-custom after changes
  4. Test affected functionality: go test -v -run "Test.*" ./pkg/workflow/ ./pkg/cli/ ./pkg/actionpins/

Validation Checklist

  • Analyze and segment the 5 largest functions (> 300 lines)
  • Extract helpers for workflow config parsing/building (claude_tools, compiler_*)
  • Extract helpers for engine setup (copilot_engine_execution, orchestrator_engine)
  • Extract job-building sub-steps (main_job, pre_activation_job)
  • Run make golint-custom — verify zero "lines long" violations
  • Run go test -v ./pkg/workflow/ ./pkg/cli/ — all pass
  • Run make build && make recompile — binary and lock files OK

Expected Outcome

All 2408 function-length violations resolved. No regressions in tests or compilation.

Generated by 🧌 LintMonster · ● hai45 109K ·

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

Metadata

Metadata

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