Fix targeted custom-linter findings outside function-length backlog#50177
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot resolve the merge conflicts on this branch. |
There was a problem hiding this comment.
Pull request overview
Resolves targeted custom-linter findings through small, behavior-preserving Go refactors.
Changes:
- Extracts helpers to satisfy function-length limits.
- Replaces unsafe sorting and loop concatenation patterns.
- Applies targeted lint-compliant checks and suppression.
Show a summary per file
| File | Description |
|---|---|
pkg/cli/compile_pipeline.go |
Uses type-safe feature sorting. |
pkg/cli/mcp_tools_readonly.go |
Builds diagnostics with strings.Builder. |
pkg/ctxutil/ctxutil.go |
Documents intentional background-context fallback. |
pkg/linters/sortslice/sortslice.go |
Extracts sort package resolution. |
pkg/parser/import_field_extractor.go |
Extracts merged-limit assignments. |
pkg/workflow/copilot_engine_execution.go |
Builds heredoc delimiters efficiently. |
pkg/workflow/copilot_logs.go |
Uses an idiomatic string emptiness check. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 7/7 changed files
- Comments generated: 0
- Review effort level: Balanced
|
@copilot This PR needs a quick maintainer-ready refresh.
Run: https://github.com/github/gh-aw/actions/runs/30882770542
|
|
@copilot This PR needs a quick maintainer-ready refresh.
Run: https://github.com/github/gh-aw/actions/runs/30886362119
|
Triage: refactor / medium risk
|
|
@copilot This PR needs a quick maintainer-ready refresh.
Run: https://github.com/github/gh-aw/actions/runs/30890137680
|
|
@copilot This PR has merge conflicts and needs a maintainer-ready refresh.
Run: https://github.com/github/gh-aw/actions/runs/30903169885
|
|
@copilot resolve the merge conflicts on this branch. |
|
@copilot merge main and recompile. Do not use agentfinder |
|
Caution agentic threat detected DetailsPotential security threats were detected in the agent output. Review the workflow run logs for details. @copilot This PR has merge conflicts and needs a maintainer-ready refresh.
Run: https://github.com/github/gh-aw/actions/runs/30909334614
|
|
@copilot resolve the merge conflicts on this branch. |
|
Warning Threat Detection Engine Failure — The analysis engine could not complete. This is a tooling failure, not a security finding. What happenedThe threat detection results could not be parsed. Review the workflow run logs for details. Triage update: refactor / medium risk
|
|
@copilot This PR has merge conflicts and needs a maintainer-ready refresh.
Run: https://github.com/github/gh-aw/actions/runs/30912825871
|
make golint-customreported six findings unrelated to the shared function-length backlog: two functions one line over the 60-line limit, onesort.Slice, two loop string concatenations, and onelen(s) > 0emptiness check. Each is addressed with a minimal, local edit.Function length (61 → under limit)
pkg/parser/import_field_extractor.go: moved the sixMergedMax*assignments out of theImportsResultliteral into a smallapplyMergedLimitsmethod.pkg/linters/sortslice/sortslice.go: extracted the selector/package resolution chain inrunintosortPackageSelector.Type-safe sorting
pkg/cli/compile_pipeline.go:sort.Slice→slices.SortFunc; thesortimport is dropped in favor ofslices.Loop concatenation →
strings.Builderpkg/workflow/copilot_engine_execution.go: heredoc delimiter escalation loop.pkg/cli/mcp_tools_readonly.go: shellcheck diagnostic accumulator;currentbecomes a builder, withcurrent.Len() > 0replacing thecurrent != ""guards andReset()on flush.Misc
pkg/workflow/copilot_logs.go:len(content.Content) > 0→content.Content != "".pkg/ctxutil/ctxutil.go://nolint:ctxbackgroundonOrBackground, whose sole purpose is to centralize thecontext.Background()fallback — the linter cannot distinguish the definition from its misuse.Remaining
golint-customoutput is limited to the pre-existing function-length backlog.Run: https://github.com/github/gh-aw/actions/runs/30886362119