Skip to content

[WIP] Refactor large functions in pkg/workflow and pkg/cli - #50405

Closed
pelikhan with Copilot wants to merge 1 commit into
mainfrom
copilot/lint-monster-function-length-refactoring-again
Closed

pelikhan with Copilot wants to merge 1 commit into
mainfrom
copilot/lint-monster-function-length-refactoring-again

Conversation

Copilot AI commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.


This section details on the original issue you should resolve

<issue_title>[lint-monster] lint-monster: function-length refactoring backlog</issue_title>
<issue_description>Authoritative tracking issue for the shared function-length refactoring backlog from the daily custom-linter scan.

Current authoritative count

  • 673 function-length findings total
  • pkg/cli: 385 findings
  • pkg/workflow: 288 findings

Scope

Treat all largefunc findings in pkg/workflow and pkg/cli as one shared backlog. Do not split into separate tracking issues by package, part number, or count snapshot.

Representative diagnostics

  • pkg/workflow/awf_helpers.go:229: BuildAWFCommand is 377 lines long.
  • pkg/workflow/safe_outputs_config_extraction.go:45: extractSafeOutputsConfig is 370 lines long.
  • pkg/workflow/awf_config.go:470: BuildAWFConfigJSON is 301 lines long.
  • pkg/cli/add_interactive_workflow.go:17: checkStatusAndOfferRun is 146 lines long.
  • pkg/cli/add_workflow_pr.go:53: addWorkflowsWithPR is 128 lines long.
  • pkg/cli/add_wizard_command.go:15: NewAddWizardCommand is 123 lines long.

Next slices to refactor

  • Start with the most localized 61-80 line functions in pkg/workflow.
  • Refactor the smallest pkg/cli overages next to retire many findings quickly.
  • Extract narrow helpers; preserve behavior and signatures where possible.
  • Re-run make golint-custom and update this issue with the new count.

Remediation guidance

  • Keep each PR scoped to a small batch of related functions.
  • Prefer helper extraction over semantic rewrites.
  • Validate with make golint-custom.

Duplicate issue handling

  • No authoritative duplicate issue could be confirmed from the current sandbox reads, so this issue is the consolidated tracker for today.

Generated by 🧌 LintMonster · gpt54 · 14.8 AIC · ⌖ 5.25 AIC · ⊞ 5.5K · ◷

  • expires on Aug 10, 2026, 7:41 PM UTC-08:00

Comments on the Issue (you are @copilot in this section)

Copilot AI linked an issue Aug 4, 2026 that may be closed by this pull request
1 of 20 tasks
Copilot AI requested a review from pelikhan August 4, 2026 21:42
Copilot stopped work on behalf of pelikhan due to an error August 4, 2026 21:42
@pelikhan pelikhan closed this Aug 4, 2026
@pelikhan
pelikhan deleted the copilot/lint-monster-function-length-refactoring-again branch August 18, 2026 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[lint-monster] lint-monster: function-length refactoring backlog

2 participants