Skip to content

[lint-monster] Refactor long functions in pkg/cli exceeding 60-line limit #35847

@github-actions

Description

@github-actions

Overview

Custom linter has identified ~776 function-length violations in pkg/cli production code. These functions exceed the 60-line limit and need to be decomposed into smaller, maintainable units.

Representative Violations

  • logs_report_test.go / logs command: Multiple functions >100 lines
  • audit_test.go / audit command: Several validation functions >80 lines
  • fix_command_test.go / fix command: Long processing functions
  • copilot_setup_test.go / setup command: Complex setup logic

Expected Approach

  1. Analyze function purpose: Identify what each function does and where it can be split
  2. Extract validation helpers: Move input validation into focused functions
  3. Extract processing logic: Move core logic into separate steps
  4. Maintain CLI interface: Keep command structure intact
  5. Validation: Run make golint-custom to confirm all cli violations are resolved

Acceptance Criteria

  • All violations in pkg/cli eliminated
  • make golint-custom reports zero pkg/cli violations
  • make test-unit passes
  • CLI commands work correctly (smoke test)

Generated by 🧌 LintMonster · haiku45 65.2K ·

  • expires on Jun 6, 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