Repository navigation
Use strings.Cut for the first path component - #75920
Conversation
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ PR Specification Reviewer completed successfully! PR Specification ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. Design Decision Gate 🏗️Outcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
There was a problem hiding this comment.
🟢 Approval recommended
The focused strings.Cut substitution preserves existing comparison behavior and source-edit protections, with no active review issues identified.
No open issues 🎉
What changed in this PR
This pull request replaces the remaining strings.Split(...)[0] usage in the source-managed workflow edit check with strings.Cut, preserving existing comparison behavior while avoiding an unnecessary allocation.
Changes:
- Extracts the first path component with
strings.Cut. - Preserves protection for direct and nested
sourceedits.
| File | Description |
|---|---|
pkg/cli/edit_command.go |
Replaces split-index extraction with strings.Cut in the source-managed edit check. |
Review effort: Lite (auto)
There was a problem hiding this comment.
Reviewed the one-line optimization in pkg/cli/edit_command.go. strings.Cut(change.path, ".") preserves the first-component comparison behavior of strings.Split(...)[0] for all relevant inputs while avoiding the allocation. No blocking issues found.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~1 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again
Co-authored-by: gh-aw-bot <15877973+gh-aw-bot@users.noreply.github.com>
* Initial plan * Bump gh-aw-firewall to v0.29.10 with verified release pins Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com> * Refresh firewall pins in workflow locks Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> * Fix stale workflow pins and registry tests Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> * Use strings.Cut for the first path component (#75920) Co-authored-by: gh-aw-bot <15877973+gh-aw-bot@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com> Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
🎉 This pull request is included in a new release. Release: |
The existing
stringssplitfirstanalyzer flagsstrings.Split(s, sep)[0]when a non-empty separator is known. Replace the remaining production occurrence in the source-managed edit check while preserving its comparison behavior.strings.Cutinstead of allocating a split slice.