Skip to content

[lint-monster] Refactor long functions in workflow and CLI packages (Part 2 of 2) #36175

@github-actions

Description

@github-actions

Summary

Refactor long functions in pkg/workflow (non-compiler) and pkg/cli packages to meet 60-line limit. Part 2: cache, action resolution, validation, and CLI functions.

Functions to Refactor (40+ functions)

pkg/workflow - Cache and Support

  • parseCacheMemoryEntry (106 lines)
  • extractCacheMemoryConfig (73 lines)
  • generateCacheSteps (101 lines)
  • generateCacheMemorySteps (119 lines)
  • buildCacheMemoryPromptSection (116 lines)
  • buildUpdateCacheMemoryJob (169 lines)

pkg/workflow - Action Resolution

  • deduplicateEntries (75 lines)
  • resolveSetupActionRef (90 lines)
  • resolveActionReference (79 lines)
  • ExtractActionsFromLockFile (64 lines)

pkg/workflow - Validation

  • validateWorkflowRunBranches (94 lines)
  • validateCallWorkflow (160 lines)
  • checkoutConfigFromMap (175 lines)
  • add (77 lines)

pkg/workflow - Engine Support

  • ParseLogMetrics antigravity (68 lines)
  • GetExecutionSteps antigravity (196 lines)
  • parseClaudeJSONLog (185 lines)
  • ParseLogMetrics copilot (136 lines)

pkg/cli - Commands and Utilities

  • audit.go functions
  • audit_diff.go functions
  • logs_download.go functions
  • mcp_inspect_mcp.go functions

Remediation Approach

  1. Extract pure utility functions
  2. Break up validation chains
  3. Use helpers for common patterns
  4. Preserve test coverage
  5. Keep related logic grouped

Checklist

  • Select 3-5 functions per category
  • Identify extraction points
  • Extract helpers with clear naming
  • Update affected tests
  • Run selective tests for files
  • Run make golint-custom
  • Run make test-unit
  • Verify make build

Expected outcome: 30-40 functions refactored to <=60 lines, zero test regressions.

Generated by 🧌 LintMonster · haiku45 134.2K ·

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