Skip to content

Fix staticcheck QF1003 and stabilize incremental lint fallback#11901

Merged
pelikhan merged 2 commits intomainfrom
copilot/fix-staticcheck-qf1003
Jan 26, 2026
Merged

Fix staticcheck QF1003 and stabilize incremental lint fallback#11901
pelikhan merged 2 commits intomainfrom
copilot/fix-staticcheck-qf1003

Conversation

Copy link
Contributor

Copilot AI commented Jan 26, 2026

CI lint failures from staticcheck QF1003 (loop variable reassignment) in pkg/campaign/interactive.go:294 and incremental lint failures when origin/main ref unavailable in PR workflows.

Changes

Fix loop variable reassignment

  • Replace owner reassignment with trimmedOwner variable to eliminate QF1003 warning
// Before
for _, owner := range owners {
    owner = strings.TrimSpace(owner)  // QF1003: reassigning loop var
    if !strings.HasPrefix(owner, "@") {
        owner = "@" + owner
    }
    config.Owners = append(config.Owners, owner)
}

// After  
for _, owner := range owners {
    trimmedOwner := strings.TrimSpace(owner)
    if !strings.HasPrefix(trimmedOwner, "@") {
        trimmedOwner = "@" + trimmedOwner
    }
    config.Owners = append(config.Owners, trimmedOwner)
}

Stabilize incremental lint workflow

  • Add fetch-depth: 0 to checkout step in lint-go job
  • Add ref verification with graceful fallback to full lint if base ref missing
if git rev-parse --verify "$BASE_REF" >/dev/null 2>&1; then
  make golint-incremental BASE_REF="$BASE_REF"
else
  make golint  # Fallback to full lint
fi
Original prompt

This section details on the original issue you should resolve

<issue_title>[deep-report] Fix staticcheck QF1003 in pkg/campaign/interactive.go and stabilize incremental lint diff</issue_title>
<issue_description>### Description
Weekly workflow analysis flagged two CI failures caused by staticcheck QF1003 in pkg/campaign/interactive.go:294 and an incremental lint diff fallback that cannot find origin/main. Update the conditional logic to use a tagged switch and ensure the lint workflow reliably has origin/main available (explicit fetch or fallback handling).

Expected Impact

Eliminates recurring CI lint failures and restores stable incremental linting behavior, reducing false negatives and failed runs.

Suggested Agent

CI Failure Doctor or go-fan

Estimated Effort

Medium (1-4 hours)

Data Source

DeepReport Intelligence Briefing 2026-01-26; workflow analysis discussion §21353267144

AI generated by DeepReport - Intelligence Gathering Agent

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


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…lback

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix staticcheck QF1003 in pkg/campaign/interactive.go Fix staticcheck QF1003 and stabilize incremental lint fallback Jan 26, 2026
Copilot AI requested a review from pelikhan January 26, 2026 15:52
@pelikhan pelikhan marked this pull request as ready for review January 26, 2026 15:54
@pelikhan pelikhan merged commit 120316b into main Jan 26, 2026
147 checks passed
@pelikhan pelikhan deleted the copilot/fix-staticcheck-qf1003 branch January 26, 2026 15:54
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.

[deep-report] Fix staticcheck QF1003 in pkg/campaign/interactive.go and stabilize incremental lint diff

2 participants