Skip to content

[linter-miner] feat(linters): add stringscutprefix linter#48210

Closed
github-actions[bot] wants to merge 7 commits into
mainfrom
linter-miner/stringscutprefix-b666afe40b10b463
Closed

[linter-miner] feat(linters): add stringscutprefix linter#48210
github-actions[bot] wants to merge 7 commits into
mainfrom
linter-miner/stringscutprefix-b666afe40b10b463

Conversation

@github-actions

@github-actions github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a new custom linter stringscutprefix that detects a common Go anti-pattern: using strings.HasPrefix(s, p) as an if condition and then calling strings.TrimPrefix(s, p) with the same arguments inside the body.

What it catches

// flagged
if strings.HasPrefix(s, "foo") {
    return strings.TrimPrefix(s, "foo")
}

// suggested replacement
after, found := strings.CutPrefix(s, "foo")
if found {
    return after
}

strings.CutPrefix (available since Go 1.20) is cleaner:

  • Single call instead of two
  • Returns (after, found) — no risk of the prefix literal or variable getting out of sync between HasPrefix and TrimPrefix
  • Matches the intent more directly

Evidence

This pattern appears repeatedly in Go codebases. The strings.CutPrefix / strings.CutSuffix functions were introduced precisely to replace this idiom, but many projects have not migrated older code. A linter enforces the migration automatically.

Implementation

  • Package: pkg/linters/stringscutprefix/
  • Analyzer name: stringscutprefix
  • Detects *ast.IfStmt whose condition is strings.HasPrefix(s, p) and whose body contains strings.TrimPrefix(s, p) with matching arguments (identifiers by object identity, literals by value, selector expressions recursively)
  • Registered in pkg/linters/registry.go
  • Includes fixture-based tests via analysistest

Generated by Linter Miner · sonnet46 · 54.7 AIC · ⌖ 9.95 AIC · ⊞ 5.6K ·

  • expires on Aug 2, 2026, 9:51 AM UTC-08:00

Run: https://github.com/github/gh-aw/actions/runs/30218624846

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 19 AIC · ⌖ 8.59 AIC · ⊞ 7.1K ·
Comment /souschef to run again


Run: https://github.com/github/gh-aw/actions/runs/30221620246

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 7.7 AIC · ⌖ 7.23 AIC · ⊞ 7.1K ·
Comment /souschef to run again


Run: https://github.com/github/gh-aw/actions/runs/30223671533

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 12.5 AIC · ⌖ 7.96 AIC · ⊞ 7.1K ·
Comment /souschef to run again


Run: https://github.com/github/gh-aw/actions/runs/30224763533

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 9.68 AIC · ⌖ 9.81 AIC · ⊞ 7.1K ·
Comment /souschef to run again


Run: https://github.com/github/gh-aw/actions/runs/30228781602

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 11.4 AIC · ⌖ 8.55 AIC · ⊞ 7.1K ·
Comment /souschef to run again


Run: https://github.com/github/gh-aw/actions/runs/30230557448

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 4.62 AIC · ⌖ 7.86 AIC · ⊞ 7.1K ·
Comment /souschef to run again


Run: https://github.com/github/gh-aw/actions/runs/30233154470

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 13 AIC · ⌖ 7.3 AIC · ⊞ 7.1K ·
Comment /souschef to run again


Run: https://github.com/github/gh-aw/actions/runs/30236419434

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 10.2 AIC · ⌖ 8.79 AIC · ⊞ 7.1K ·
Comment /souschef to run again

Detects if-blocks that check strings.HasPrefix(s, p) then call
strings.TrimPrefix(s, p) with the same arguments inside the body,
and suggests using strings.CutPrefix (available since Go 1.20) instead.

strings.CutPrefix is cleaner: it returns (after, found) in a single
call, eliminating the redundant HasPrefix check and the risk of the
prefix and variable getting out of sync between the two calls.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added automation cookie Issue Monster Loves Cookies! go-linters labels Jul 26, 2026
@pelikhan
pelikhan marked this pull request as ready for review July 26, 2026 20:09
Copilot AI review requested due to automatic review settings July 26, 2026 20:09
@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

PR Code Quality Reviewer completed the code quality review.

@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

Design Decision Gate 🏗️ completed the design decision gate check.

@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

Test Quality Sentinel completed test quality analysis.

@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a Go analyzer detecting strings.HasPrefix followed by matching strings.TrimPrefix calls.

Changes:

  • Implements stringscutprefix.
  • Adds fixture-based analyzer tests.
  • Registers the analyzer globally.
Show a summary per file
File Description
pkg/linters/stringscutprefix/stringscutprefix.go Implements detection and expression matching.
pkg/linters/stringscutprefix/stringscutprefix_test.go Runs analyzer fixtures.
pkg/linters/stringscutprefix/testdata/src/stringscutprefix/stringscutprefix.go Provides positive and negative cases.
pkg/linters/registry.go Registers the analyzer.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comments suppressed due to low confidence (2)

pkg/linters/stringscutprefix/stringscutprefix.go:141

  • Comparing literal source text misses semantically equal prefixes such as "foo" versus a raw-string foo, or "\x66oo" versus "foo", despite the promised value-based matching. Compare the type-checker's constant values instead, and add a fixture with alternate literal spellings.
		return ok && av.Kind == bv.Kind && av.Value == bv.Value

pkg/linters/stringscutprefix/stringscutprefix.go:129

  • Parentheses are not normalized, so equivalent arguments such as HasPrefix((s), "foo") and TrimPrefix(s, "foo") are missed. Unwrap ParenExpr on either input before comparing and add a fixture for this form.
func sameExpr(pass *analysis.Pass, a, b ast.Expr) bool {
  • Files reviewed: 4/4 changed files
  • Comments generated: 2
  • Review effort level: Medium

Comment thread pkg/linters/registry.go
stringsconcatloop.Analyzer,
stringsindexcontains.Analyzer,
stringsindexhasprefix.Analyzer,
stringscutprefix.Analyzer,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already addressed in d63b6b4: /home/runner/work/gh-aw/gh-aw/pkg/linters/doc.go, /home/runner/work/gh-aw/gh-aw/pkg/linters/README.md, and /home/runner/work/gh-aw/gh-aw/pkg/linters/spec_test.go now include stringscutprefix, and TestDocSurfacesMatchRegistryAndSpecList passes locally.

// to strings.TrimPrefix with arguments that textually match s and prefix.
func bodyContainsTrimPrefix(pass *analysis.Pass, body *ast.BlockStmt, s, prefix ast.Expr) bool {
found := false
ast.Inspect(body, func(n ast.Node) bool {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already addressed in d63b6b4: /home/runner/work/gh-aw/gh-aw/pkg/linters/stringscutprefix/stringscutprefix.go now restricts matches to the direct statement shape, skips nested flow/closures, and stops after reassignment, and /home/runner/work/gh-aw/gh-aw/pkg/linters/stringscutprefix/testdata/src/stringscutprefix/stringscutprefix.go covers the negative cases. make test-unit passes locally for the linter packages.

@github-actions

Copy link
Copy Markdown
Contributor Author

🧪 Test Quality Sentinel Report

Test Quality Score: 40/100 — Poor

Analyzed 1 test: 1 design test, 0 implementation tests. 1 hard violation detected.

📊 Metrics (1 test)
Metric Value
Analyzed 1 (Go: 1, JS: 0)
✅ Design 1 (100%)
⚠️ Implementation 0 (0%)
Edge/error coverage 4 (positive/negative cases in test data)
Test inflation No (13 lines test vs 157 lines prod = 0.08:1)
🚨 Violations 1
Test File Classification Issues
TestAnalyzer stringscutprefix_test.go:11-13 Design ✅ Valid design test using analysistest framework with 4 scenarios in testdata
⚠️ Hard Violations (1)

Missing Build Tagstringscutprefix_test.go line 1

The test file is missing the required //go:build !integration tag on the first line. All Go test files in this repository follow the pattern established by sibling linters (e.g., appendbytestring_test.go).

Fix: Add //go:build !integration as the first line of the file.

Verdict

failed. Hard violation: missing required build tag on line 1. This is a coding guideline violation that must be resolved per repository standards.

🧪 Test quality analysis by Test Quality Sentinel · haiku45 · 16.5 AIC · ⌖ 6.73 AIC · ⊞ 8.1K ·
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Test Quality Sentinel: 40/100. Hard violation: missing required //go:build !integration tag on line 1 of stringscutprefix_test.go. This is a coding guideline violation that must be resolved per repository standards. Review flagged tests in the comment above.

@github-actions

Copy link
Copy Markdown
Contributor Author

🏗️ Design Decision Gate — ADR Required

This PR makes significant changes to core business logic (215 new lines in pkg/ directories) but does not have a linked Architecture Decision Record (ADR).

📄 Draft ADR committed: docs/adr/48210-add-stringscutprefix-linter.md — review and complete it before merging.

🔒 This PR cannot merge until an ADR is linked in the PR body.

📋 What to do next
  1. Review the draft ADR committed to your branch — it was generated from the PR diff
  2. Complete the missing sections — add context the AI could not infer, refine the decision rationale, and list real alternatives you considered
  3. Commit the finalized ADR to docs/adr/ on your branch
  4. Reference the ADR in this PR body by adding a line such as:

    ADR: ADR-48210: Add stringscutprefix Linter for strings.CutPrefix Migration

Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision.

❓ Why ADRs Matter

"AI made me procrastinate on key design decisions. Because refactoring was cheap, I could always say 'I'll deal with this later.' Deferring decisions corroded my ability to think clearly."

ADRs create a searchable, permanent record of why the codebase looks the way it does. Future contributors (and your future self) will thank you.

📋 Michael Nygard ADR Format Reference

An ADR must contain these four sections to be considered complete:

  • Context — What is the problem? What forces are at play?
  • Decision — What did you decide? Why?
  • Alternatives Considered — What else could have been done?
  • Consequences — What are the trade-offs (positive and negative)?

All ADRs are stored in docs/adr/ as Markdown files numbered by PR number (e.g., 48210-add-stringscutprefix-linter.md for PR #48210).

🏗️ ADR gate enforced by Design Decision Gate 🏗️ · sonnet46 · 49.8 AIC · ⌖ 10 AIC · ⊞ 8.5K ·
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: stringscutprefix linter

Overall the implementation is correct and well-structured. Two non-blocking issues worth addressing:

  1. Closure traversal (false positives) - bodyContainsTrimPrefix uses ast.Inspect which descends into FuncLit nodes. A strings.TrimPrefix call inside an inline closure in the if body will trigger the diagnostic even if the closure is never invoked. See inline comment at line 95.

  2. Dead fallback in sameExpr - The a.Pos() == b.Pos() fallback will never return true for two distinct subexpressions (they cannot share a position), so it misleads rather than helps. See inline comment at line 154.

Neither blocks merging the linter behaves correctly for all common cases but fixing them improves correctness and code clarity.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 32 AIC · ⌖ 4.73 AIC · ⊞ 5K

Comment thread pkg/linters/stringscutprefix/stringscutprefix.go
Comment thread pkg/linters/stringscutprefix/stringscutprefix.go

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REQUEST_CHANGES — Three correctness issues must be fixed before this linter ships.

### Blocking issues
  1. False positives on nested calls (line 113): uses which recurses into all nested blocks. If is inside a nested /, the diagnostic fires but the suggested fix (swap to ) is structurally incorrect. Only top-level occurrences in qualify.

  2. ** position fallback always returns false** (line 182): The fallback a.Pos() == b.Pos() for unhandled expression types (calls, unary, binary) compares positions that are always different between the args and the args — silently producing false negatives for any complex argument expression. Replace with an explicit return false and a comment.

  3. ** selector compared by name string, not type identity** (line 173): av.Sel.Name == bv.Sel.Name can match unrelated fields with the same name on different types. Use TypesInfo.ObjectOf(av.Sel) == TypesInfo.ObjectOf(bv.Sel), consistent with the *ast.Ident branch.

### Non-blocking
  • in is never consumed via ; if needs it, that dependency belongs to 's analyzer, not here.
  • Test data has no case for nested (should be a non-flagged case) or complex argument expressions.

🔎 Code quality review by PR Code Quality Reviewer · sonnet46 · 43.2 AIC · ⌖ 5.02 AIC · ⊞ 5.7K
Comment /review to run again

Comments that could not be inline-anchored

pkg/linters/stringscutprefix/stringscutprefix.go:113

False positives when TrimPrefix appears in nested statements: bodyContainsTrimPrefix walks the entire subtree recursively via ast.Inspect, so it flags the outer if even when TrimPrefix is inside a nested if/for. The suggested replacement (strings.CutPrefix) only works as a direct swap when TrimPrefix is at the top level of the block.

<details>
<summary>💡 Explanation and fix</summary>

This pattern would be incorrectly flagged:

if strings.HasPrefix(s, &quot;foo&quot;) {
    …

</details>

<details><summary>pkg/linters/stringscutprefix/stringscutprefix.go:182</summary>

**`sameExpr` position-equality fallback is a dead no-op that silently produces false negatives**: For expression types not handled by the switch (e.g., `*ast.CallExpr`, `*ast.UnaryExpr`, `*ast.BinaryExpr`), the fallback compares `a.Pos() == b.Pos()`. The `s` and `prefix` arguments come from the `HasPrefix` call; the matching arguments inside the body come from a `TrimPrefix` call at a different source location — they will never share a `Pos()`. This always returns `false`, silently missing patt…

</details>

<details><summary>pkg/linters/stringscutprefix/stringscutprefix.go:173</summary>

**`SelectorExpr` comparison uses string name equality for the selector field, not type identity**: `av.Sel.Name == bv.Sel.Name` can produce false positives when two different types have a field with the same name and both receivers resolve to the same object (e.g., promoted fields from embedded structs).

&lt;details&gt;
&lt;summary&gt;💡 Suggested fix&lt;/summary&gt;

Compare using `TypesInfo.ObjectOf` for the selector, consistent with the `*ast.Ident` case:

```go
case *ast.SelectorExpr:
    bv, ok := b.(*ast.…

</details>

<details><summary>pkg/linters/stringscutprefix/stringscutprefix.go:50</summary>

**`inspect.Analyzer` is listed as a dependency but never used**: `pass.ResultOf[inspect.Analyzer]` is never called in `run`. The dependency declaration forces the analysis framework to run the inspect pass for this package unnecessarily.

&lt;details&gt;
&lt;summary&gt;💡 Fix&lt;/summary&gt;

Remove `inspect.Analyzer` from `Requires` — `astutil.Root` presumably handles its own dependency. If `astutil.Root` internally uses the inspect pass result, that dependency should be declared by `astutil`&#39;s underlying analy…

</details>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /tdd — requesting changes on two correctness issues.

📋 Key Themes & Highlights

Issues

  • False positive via closure (line 89): bodyContainsTrimPrefix walks into nested *ast.FuncLit nodes. A TrimPrefix call inside a closure is not equivalent to a direct call in the if body; stop traversal at FuncLit boundaries (consistent with manualmutexunlock and other linters here).
  • Dead-code fallback in sameExpr (line 156): the a.Pos() == b.Pos() check is always false for arguments coming from two distinct call expressions. Replace it with a plain return false so intent is clear.

Positive Highlights

  • ✅ Solid use of type-aware matching (pass.TypesInfo.ObjectOf) to avoid string-comparison false positives on locally-renamed strings imports
  • ✅ Correct infrastructure wiring: nolint directives, generated-file skipping, inspect.Analyzer dependency
  • ✅ Good fixture coverage for field selectors and mismatched arguments

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 45.7 AIC · ⌖ 4.95 AIC · ⊞ 6.7K
Comment /matt to run again

Comment thread pkg/linters/stringscutprefix/stringscutprefix.go Outdated
Comment thread pkg/linters/stringscutprefix/stringscutprefix.go Outdated
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, review the current branch state, address the unresolved feedback below, and reply with whether this PR is ready for maintainer review.

Unresolved review threads (newest first):

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 19 AIC · ⌖ 8.59 AIC · ⊞ 7.1K ·
Comment /souschef to run again

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

@copilot please run the pr-finisher skill, review the current branch state, address the unresolved feedback below, and reply with whether this PR is ready for maintainer review.

Unresolved review t...

Addressed the unresolved code feedback in d63b6b4. The analyzer now avoids closure/nested-branch/reassignment false positives, the negative fixtures and required build tag are in place, and the doc/spec surfaces are synced. Local validation passed (make lint, make test, make agent-report-progress), and the earlier failing impacted/unit-test drift is fixed locally. This PR is not fully ready for maintainer review yet because GitHub still shows an unstable/action-required merge state on the new head, so CI on d63b6b4 still needs maintainer follow-up/re-trigger.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, verify the branch is up to date, and rerun checks after confirming the remaining work on this PR.

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 7.7 AIC · ⌖ 7.23 AIC · ⊞ 7.1K ·
Comment /souschef to run again

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, and rerun checks once the branch is up to date.

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 9.68 AIC · ⌖ 9.81 AIC · ⊞ 7.1K ·
Comment /souschef to run again

Copilot AI commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

@copilot please run the pr-finisher skill, and rerun checks once the branch is up to date.

...

Branch is up to date on 3ab8f50; I unshallowed /home/runner/work/gh-aw/gh-aw, fetched origin/main, and confirmed the branch already contains base commit d4872c2.

I reran the local checks on the current head:

  • make fmt
  • make lint
  • make test-unit
  • make test ❌ only because of an unrelated pre-existing pkg/cli failure on the merged base: TestFallbackAWFilesMatchesLocalAWDirectory expects linter-workflows.md in pkg/cli/data/agentic_workflows_fallback_aw_files.json

I also checked the recent workflow state: the latest branch-attached run is the current Copilot run, and the referenced PR Sous Chef run (30224763533) had no failed jobs. There is no new PR-specific CI failure for stringscutprefix to fix in this pass.

No additional stringscutprefix code changes were needed. For the linter work itself, this PR is ready for maintainer review, but CI on this head is still unverified until a maintainer re-triggers it, and the unrelated pkg/cli fallback-AW drift still needs maintainer follow-up if make test must be green before merge.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, address the unresolved review feedback below, and rerun checks once the branch is up to date.

Unresolved review threads:

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 11.4 AIC · ⌖ 8.55 AIC · ⊞ 7.1K ·
Comment /souschef to run again

Copilot AI commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

@copilot please run the pr-finisher skill, address the unresolved review feedback below, and rerun checks once the branch is up to date.

Unresolved review threads:...

Branch is up to date on 3ab8f50; I re-fetched origin/main in /home/runner/work/gh-aw/gh-aw and confirmed the branch already contains base commit d4872c2.

Of the seven threads listed here, five are already resolved in GitHub. The two still-open Copilot reviewer threads are already satisfied by the current branch, and I replied on those threads with the exact locations of the fixes in d63b6b4.

Local validation on the current head:

  • make fmt
  • make lint
  • make test-unit
  • make test ❌ only because of unrelated pre-existing pkg/cli fallback-AW drift on the merged base: TestFallbackAWFilesMatchesLocalAWDirectory expects linter-workflows.md in /home/runner/work/gh-aw/gh-aw/pkg/cli/data/agentic_workflows_fallback_aw_files.json

Recent CI state I could inspect in this pass:

  • PR Sous Chef run 30228781602 had no failed jobs
  • The branch currently shows the active Copilot run plus the earlier successful Copilot run
  • CI on this head is still unverified until a maintainer re-triggers it

No additional stringscutprefix code changes were needed in this pass. For the linter work itself, this PR is ready for maintainer review, with maintainer follow-up still needed to re-trigger CI and to handle the unrelated pkg/cli fallback-AW drift if make test must be green before merge.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, address unresolved review feedback and any failing checks, then rerun the relevant checks once the branch is ready for maintainer review.

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 4.62 AIC · ⌖ 7.86 AIC · ⊞ 7.1K ·
Comment /souschef to run again

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

@copilot please run the pr-finisher skill, address unresolved review feedback and any failing checks, then rerun the relevant checks once the branch is ready for maintainer review.

...

Addressed one more in-scope follow-up in 4320336: /home/runner/work/gh-aw/gh-aw/pkg/linters/stringscutprefix/stringscutprefix.go now unwraps parenthesized expressions and compares selector identity by type info, and /home/runner/work/gh-aw/gh-aw/pkg/linters/stringscutprefix/testdata/src/stringscutprefix/stringscutprefix.go covers the parenthesized case.

Local checks on this head:

  • make fmt
  • make lint
  • make test-unit ✅ (after unshallowing and fetching origin/main so impacted tests could compute merge-base)
  • make test ❌ only because of the unrelated pre-existing pkg/cli integration failure TestFallbackAWFilesMatchesLocalAWDirectory

I also inspected the last-known CI state with GitHub Actions tools: the recent action_required runs on this branch had no failed jobs/logs to fix, and CI on 4320336 is still stale/unverified until a maintainer re-triggers it. For the stringscutprefix changes themselves, this PR is ready for maintainer review, with maintainer follow-up still needed to re-trigger CI and handle the unrelated pkg/cli drift if full make test must be green before merge.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, update the branch if GitHub allows it, and move this PR toward merge readiness.

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 13 AIC · ⌖ 7.3 AIC · ⊞ 7.1K ·
Comment /souschef to run again

Copilot AI commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

@copilot please run the pr-finisher skill, update the branch if GitHub allows it, and move this PR toward merge readiness.

...

No branch update was needed: the current head 4320336 already contains the PR base commit d4872c2, and fetching origin/main locally fixed the impacted-test merge-base lookup.

I rechecked the current branch state and the stringscutprefix feedback remains satisfied on this head. Local validation now shows:

  • make fmt
  • make lint
  • make test-unit
  • make test ❌ only because of the unrelated pre-existing pkg/cli fallback-AW drift (TestCheckedInAgenticWorkflowsSkillMatchesGeneratedContent / TestFallbackAWFilesMatchesLocalAWDirectory expecting linter-workflows.md in /home/runner/work/gh-aw/gh-aw/pkg/cli/data/agentic_workflows_fallback_aw_files.json)

I also inspected the recent branch workflow runs with the Actions MCP tools: the action_required runs on 4320336 have no failed jobs/logs available, so CI on this head is still stale/unverified until a maintainer re-triggers it.

For the stringscutprefix work itself, this PR is ready for maintainer review once CI is re-triggered by a maintainer.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, address the unresolved review feedback on this linter PR, and rerun the relevant checks once fixes are ready. Focus first on the blocking correctness reviews from github-actions about nested traversal false positives, dead sameExpr fallback behavior, selector/type-identity matching, and related fixture coverage.

Generated by PR Sous Chef: https://github.com/github/gh-aw/actions/runs/30236419434

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 10.2 AIC · ⌖ 8.79 AIC · ⊞ 7.1K ·
Comment /souschef to run again

Copilot AI commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

@copilot please run the pr-finisher skill, address the unresolved review feedback on this linter PR, and rerun the relevant checks once fixes are ready. Focus first on the blocking correctness revie...

I rechecked the current branch and the blocking github-actions linter feedback is already addressed on the existing head (4320336, with the earlier traversal/doc-sync fixes in d63b6b4). In /home/runner/work/gh-aw/gh-aw/pkg/linters/stringscutprefix/stringscutprefix.go, the analyzer now skips nested flow/closures, stops after reassignment, uses selector/type identity via TypesInfo.ObjectOf, and treats unsupported complex expressions as unequal instead of using the dead position fallback. /home/runner/work/gh-aw/gh-aw/pkg/linters/stringscutprefix/testdata/src/stringscutprefix/stringscutprefix.go also includes the negative closure/nested-branch/reassignment coverage, and /home/runner/work/gh-aw/gh-aw/pkg/linters/stringscutprefix/stringscutprefix_test.go has the required build tag.

I reran the relevant local checks on this head:

  • go test ./pkg/linters/...
  • go test ./pkg/linters -run 'TestDocSurfacesMatchRegistryAndSpecList|TestSpec'

No additional linter code changes were needed in this pass. CI on the PR head is still unverified/stale until a maintainer re-triggers it.

@pelikhan

Copy link
Copy Markdown
Collaborator

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

@copilot fix https://github.com/github/gh-aw/actions/runs/30231536989/job/89887574668

Fixed in a8e184f615. I synced pkg/cli/data/agentic_workflows_fallback_aw_files.json by adding the missing linter-workflows.md entry that TestFallbackAWFilesMatchesLocalAWDirectory was failing on. Verified with go test ./pkg/cli -run 'TestFallbackAWFilesMatchesLocalAWDirectory|TestCheckedInAgenticWorkflowsSkillMatchesGeneratedContent' and the repo’s final make agent-report-progress validation path.

Copilot AI requested a review from pelikhan July 27, 2026 04:51
@pelikhan pelikhan closed this Jul 27, 2026
@github-actions github-actions Bot added the closed:ci-failure PR was closed without merging: ci-failure label Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation closed:ci-failure PR was closed without merging: ci-failure cookie Issue Monster Loves Cookies! go-linters

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants