Skip to content

[lint-monster] Refactor long functions in pkg/workflow and pkg/actionpins (300+ violations) #34160

@github-actions

Description

@github-actions

Summary

The pkg/workflow and pkg/actionpins packages contain approximately 300+ functions exceeding the 60-line limit. These should be broken down into smaller, more testable units.

Affected Functions (Sample - See full list in logs)

pkg/workflow (290+ functions)

  • claude_engine.go:120 — GetExecutionSteps (373 lines)
  • claude_logs.go:145 — parseClaudeJSONLog (185 lines)
  • claude_tools.go:168 — computeAllowedClaudeToolsString (360 lines)
  • codex_engine.go:146 — GetExecutionSteps (286 lines)
  • command.go:16 — buildEventAwareCommandCondition (187 lines)
  • compiler.go:121 — generateAndValidateYAML (120 lines)
  • compiler.go:382 — CompileWorkflowData (150 lines)
  • compiler_main_job.go:26 — buildMainJob (372 lines)
  • compiler_orchestrator_engine.go:35 — setupEngineAndImports (391 lines)
  • compiler_orchestrator_frontmatter.go:37 — parseFrontmatterSection (162 lines)
  • And 280+ more functions (including test files with long table-driven tests)

pkg/actionpins (10+ functions)

  • actionpins.go:303 — ResolveActionPin (105 lines)

Refactoring Strategy

  1. Analyze call graphs — Understand which functions can be split independently
  2. Extract core logic — Separate validation, parsing, and generation phases
  3. Create domain helpers — Group related operations (e.g., engine setup, job building)
  4. Preserve public APIs — Only break internal/private functions
  5. Test coverage — Ensure all new helpers have unit tests

Note on Test Functions

Long test functions (table-driven tests with many cases) are acceptable when they test a single behavior exhaustively. Prioritize fixing production code first; flag excessively long test functions for secondary review.

Validation

Run make golint-custom after refactoring to verify all violations are resolved.

Expected Outcome

All functions in pkg/workflow and pkg/actionpins reduced to ≤60 lines without functional changes.

Zero new lint errors introduced.

Generated by 🧌 LintMonster · ● 77.9K ·

  • expires on May 30, 2026, 3:49 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