Skip to content

Enable staticcheck style checks - #3416

Open
tbavelier wants to merge 1 commit into
mainfrom
tbavelier/enable-staticcheck-style
Open

Enable staticcheck style checks#3416
tbavelier wants to merge 1 commit into
mainfrom
tbavelier/enable-staticcheck-style

Conversation

@tbavelier

Copy link
Copy Markdown
Member

What does this PR do?

Enables and fixes the actionable Staticcheck style analyzers on top of #3415:

  • ST1003: conventional initialism naming for non-versioned API code
  • ST1005: idiomatic error strings, preserving proper nouns with documented exceptions
  • ST1006: unnamed unused receivers
  • ST1020 and ST1021: exported declaration comments

Compatibility aliases are retained for the renamed EntityKubeApiServer, GetApiVersions, and SetApiExtensionClient APIs. Generated CRD and OpenAPI artifacts are updated for API documentation changes.

Motivation

This follows the correctness and quick-fix rollout in #3415 with a separately reviewable, stylistic cleanup.

Additional Notes

Depends on #3415 and targets its branch so this PR contains only the Staticcheck style changes.

ST1000 remains excluded because it reports 409 missing package comments across 130 packages. Eighteen ST1003 findings in versioned API definitions are narrowly excluded because renaming those exported fields and constants would be breaking.

Next linters and analyzer groups to evaluate:

  • errcheck (50+ existing findings)
  • gosec (50+ findings)
  • contextcheck (62 findings)
  • forcetypeassert (24 findings)
  • exhaustive (19 findings)
  • SA1019 controller-runtime deprecations
  • ST1000 package documentation as a dedicated cleanup, if desired

Minimum Agent Versions

No minimum Datadog Agent or Cluster Agent version is required.

Describe your test plan

  • make generate && make manifests
  • go test ./...
  • make fmt
  • make lint
  • golangci-lint config verify

Checklist

  • PR has at least one valid label: enhancement
  • PR has milestone v1.31.0 and label qa/skip-qa
  • All commits are signed

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Sep 2, 2026

Copy link
Copy Markdown

Code Coverage  Pipelines

🛑 Gate Violations

🎯 1 Code Coverage issue detected

A Patch coverage percentage gate may be blocking this PR.

Patch coverage: 38.78% (threshold: 80.00%)

ℹ️ Info

🎯 Code Coverage (details)
Patch Coverage: 38.78%
Overall Coverage: 50.57% (-0.00%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 49421ec | Docs | View more details | Give us feedback!

Base automatically changed from tbavelier/enable-linters to main September 2, 2026 14:50
@tbavelier
tbavelier force-pushed the tbavelier/enable-staticcheck-style branch from 677e306 to 49421ec Compare September 2, 2026 14:53
@tbavelier
tbavelier marked this pull request as ready for review September 3, 2026 08:37
@tbavelier
tbavelier requested a review from a team September 3, 2026 08:37
@tbavelier
tbavelier requested review from a team as code owners September 3, 2026 08:37
@tbavelier
tbavelier requested review from RemiMoustamsikdd and removed request for a team September 3, 2026 08:37
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-03T08:39:46.695545Z 49421ec Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant