Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[lint-monster] Refactor functions exceeding 60-line limit (2400+ violations) #33915

@github-actions

Description

@github-actions

Summary

Over 2,400 function-length violations across parser, actionpins, and workflow packages. Functions range from 62 to 492 lines; limit is 60 lines per function.

Packages Affected

  • pkg/parser (highest concentration): import_bfs (492L), mcp (253L), ParseMCPConfig (253L), and 100+ others
  • pkg/workflow (largest subsystem): compiler_pre_activation_job (486L), compiler_main_job (372L), claude_tools (360L), and 100+ others
  • pkg/actionpins: ResolveActionPin (105L)

Top Violations (by line count)

  1. pkg/parser/import_bfs.go:21 - processImportsFromFrontmatterWithManifestAndSource (492L)
  2. pkg/workflow/compiler_pre_activation_job.go:20 - buildPreActivationJob (486L)
  3. pkg/workflow/compiler_main_job.go:26 - buildMainJob (372L)
  4. pkg/workflow/claude_tools.go:168 - computeAllowedClaudeToolsString (360L)
  5. pkg/parser/mcp.go:432 - ParseMCPConfig (253L)

Refactoring Strategy

For each function exceeding 60 lines:

  1. Identify logical segments - Split by distinct concerns or phases
  2. Extract helpers - Create private helper functions for each segment
  3. Preserve behavior - No logic changes, only structural refactoring
  4. Update call sites - Replace inline code with helper calls
  5. Test validation - Run existing tests to ensure no behavioral changes

Validation

After refactoring batch:

  • Run make golint-custom | grep "lines long" to verify progress
  • Run selective tests: go test -v -run "Test<RelatedName>" ./pkg/<package>/
  • Commit with message: "refactor: break up (package) functions exceeding 60-line limit"

Expected Outcome

All functions ≤60 lines; make golint-custom shows zero "lines long" violations in assigned packages.

Generated by 🧌 LintMonster · ● 79.6K ·

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

Metadata

Metadata

Assignees

No one assigned

    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