Skip to content

Enforce errorlint and nilerr on changed Go code #2285

Done

Description

@skevetter

Scope

Add changed-code enforcement for errorlint and nilerr with the existing golangci-lint v2.15.0 pin. Use separate signed draft PRs for the two rules; link both here and close this issue only once both pass.

Baseline

Full rule-isolated Linux/amd64 runs on ade0dc178682e7658ef465322d10bf42eae302b2 found 44 errorlint diagnostics (13 wrapping, 31 comparison/assertion/type switch) and 53 nilerr diagnostics. The root/logging split was 43/1 and 53/0. Existing findings are not a mandate to rewrite their packages.

Acceptance

  • errorlint: enable comparisons and assertions/type switches, not wrapping-format checks. Do not change API error chains just to satisfy the linter.
  • nilerr: enforce changed lines; preserve documented fallbacks and Pools cancellation/cleanup behavior. No blanket suppression or baseline cleanup.
  • Reuse the root changed-code patch gate. The logging module also uses the root config in an existing full lint job; keep that job's behavior unchanged. Verify the rollout cannot accidentally activate the new baselines in full logging, pre-commit, or other existing lint commands. If needed, opt the new analyzers in only in the changed-code gate.
  • Prove a new finding fails, a clean change passes, and an untouched existing finding does not fail changed-code CI. Retain the pin, current required checks and coverage. The separate remote stream error fix is not in scope.

Activity

  1. coderabbitai commented on Dec 4, 2026

    @coderabbitai
    🔗 Related PRs

    #1852 - fix(ci): lint complete pull request diffs [closed]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions