Skip to content

[deep-report] Extend ctxbackground linter to flag bare exec.Command inside context-receiving functions #38143

Description

@github-actions

Description

The ctxbackground linter currently flags only context.Background() misuse. It does not flag bare exec.Command(...) calls made inside functions that already receive a context.Context parameter — which is exactly how the context-propagation debt keeps growing (109 bare exec.Command vs 24 exec.CommandContext, 0 progress since 2026-06-03). Extend the linter (or add a sibling analyzer) to report exec.Command invoked within a context-receiving function and suggest exec.CommandContext(ctx, ...). Use pass.TypesInfo for type-accurate matching, consistent with the other 22 custom analyzers.

Expected Impact

Turns a recurring, manually-tracked debt into an automatically-enforced rule, preventing new un-cancellable subprocess spawns from landing. High leverage: stops the regression at the source rather than chasing 32 files by hand.

Suggested Agent

copilot-swe-agent (linter work; follows the existing cmd/linters / pkg/linters analyzer pattern).

Estimated Effort

Medium (1-4 hours).

Data Source

DeepReport 2026-06-09 analysis — Repository Quality: Context Propagation & Process Cancellability (#38123).

Generated by 🔬 DeepReport - Intelligence Gathering Agent · 277.3 AIC · ⌖ 18.6 AIC · ⊞ 10.6K ·

  • expires on Jun 11, 2026, 7:52 AM UTC-08:00

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions