Skip to content

[lint-monster] [Lint] Break up long functions in pkg/cli/ (5 issues) #35367

@github-actions

Description

@github-actions

Summary

Functions in pkg/cli/ exceed the 60-line limit. Refactor 5 functions to meet the target size guideline.

Affected Functions

  1. pkg/cli/access_log.go:50 - parseSquidAccessLog (76 lines)
  2. pkg/cli/actionlint.go:222 - runActionlintOnFilesWithOptions (184 lines)
  3. pkg/cli/actionlint.go:411 - parseAndDisplayActionlintOutput (67 lines)
  4. pkg/cli/actions_build_command.go:201 - buildAction (83 lines)
  5. pkg/cli/add_command.go:49 - NewAddCommand (137 lines)

Remediation Approach

For each function:

  • Analyze function logic and identify distinct logical blocks
  • Extract helper functions for sub-domains (validation, parsing, rendering)
  • Keep public interfaces stable; internal helpers can be private
  • Update function names to reflect extracted logic: {verb}_{noun}
  • Run make golint-custom after each change
  • Verify no behavioral changes with go test -run <affected_test> ./pkg/cli/

Validation

Run make golint-custom to confirm zero lint errors for these 5 functions.

Generated by 🧌 LintMonster · haiku45 86.4K ·

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