Skip to content

Enforce ctxbackground in cgo custom lint - #51936

Merged
pelikhan merged 2 commits into
mainfrom
copilot/add-ctxbackground-analyzer-to-linter
Aug 11, 2026
Merged

Enforce ctxbackground in cgo custom lint#51936
pelikhan merged 2 commits into
mainfrom
copilot/add-ctxbackground-analyzer-to-linter

Conversation

Copilot AI commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

ctxbackground is already type-resolved, documented, and clean for production code, but was not included in the CI-enforced custom linter set. This adds it to the cgo workflow so context.Background() misuse is gated in both supported lint configurations.

  • Custom linter enforcement
    • Added -ctxbackground to the default make golint-custom LINTER_FLAGS.
    • Added -ctxbackground to the wasm GOOS=js GOARCH=wasm make golint-custom LINTER_FLAGS.
LINTER_FLAGS="... -contextcancelnotdeferred -ctxbackground -wgdonenotdeferred ..."

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review August 11, 2026 05:10
Copilot AI balanced review requested due to automatic review settings August 11, 2026 05:10
@pelikhan
pelikhan merged commit 9abed35 into main Aug 11, 2026
1 check passed
@pelikhan
pelikhan deleted the copilot/add-ctxbackground-analyzer-to-linter branch August 11, 2026 05:10

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

Enables the existing ctxbackground analyzer in CI for default and WebAssembly Go builds.

Changes:

  • Adds -ctxbackground to both custom-linter invocations.
  • Preserves production-only linting via -test=false.
Show a summary per file
File Description
.github/workflows/cgo.yml Enables ctxbackground in default and wasm lint checks.

Review details

Tip

Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Balanced

Copilot AI restored the copilot/add-ctxbackground-analyzer-to-linter branch August 11, 2026 05:11
Copilot AI changed the title [WIP] Add ctxbackground analyzer to CI linter set Enforce ctxbackground in cgo custom lint Aug 11, 2026
Copilot AI requested a review from pelikhan August 11, 2026 05:12
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.86.2

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.

ctxbackground: zero-violation analyzer ready for CI enforcement, missing from LINTER_FLAGS

3 participants