Enable additional golangci-lint checks - #3415
Merged
Merged
Conversation
3 tasks
This comment has been minimized.
This comment has been minimized.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Mathew-Estafanous
approved these changes
Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Enables eleven low-churn golangci-lint checks:
bodyclose,containedctx,dupword,errchkjson,gomoddirectivesmusttag,nolintlint,rowserrcheck,sqlclosecheck,staticcheck,wastedassignIt also enables the Staticcheck correctness and quick-fix analyzers, fixes the resulting findings, and updates legacy golangci-lint v2 configuration keys.
Motivation
Several useful correctness, resource-safety, and configuration checks were disabled globally. Enabling the clean or tractable checks prevents new violations while keeping the initial rollout reviewable.
Additional Notes
This is the base of a two-PR branch stack. Follow-up #3416 enables the actionable Staticcheck style checks.
Next linters and analyzer groups to evaluate:
errcheck(50+ existing findings), prioritizing meaningful unchecked returns over output/cleanup noisegosec(50+ findings), with a security-focused review of each suppressioncontextcheck(62 findings), which requires context propagation through controller call chainsforcetypeassert(24 findings) andexhaustive(19 findings), both requiring behavioral decisionsSA1019, after planning controller-runtime typed-apply and event-recorder migrationsMinimum Agent Versions
No minimum Datadog Agent or Cluster Agent version is required.
Describe your test plan
make generate && make manifestsgo test ./...make fmtmake lintgolangci-lint config verifyChecklist
enhancementv1.31.0and labelqa/skip-qa