Skip to content

chore(lint): burn down 2,769 remaining non-errcheck golangci findings keeping Lint Code red #1342

Description

@cristim

Follow-up to #1339. After the errcheck wave is fixed (branch fix/ci-main-red, errcheck now 0), the CI "Lint Code" job will still be red: 2,769 non-errcheck findings remain repo-wide under the strict .golangci.yml v2 config that landed 2026-06-09 (commit b54f06d), which is what turned main's CI red on 2026-06-11.

Breakdown (local run, golangci-lint 2.11.4; counts match live CI run 28541474929 annotations almost exactly, small govet/gosec deltas likely from the CI-pinned 2.10.1):

  • godot 1187
  • misspell 604 (note: repo convention uses "cancelled" spelling matching DB status vocabulary; those need targeted per-line justification or an ignore-words config decision, NOT blind respelling)
  • gocritic 446
  • govet 365 (mostly fieldalignment)
  • unparam 36
  • noctx 34
  • errorlint 29
  • gosec 23 (review individually; severity error in config)
  • staticcheck 20
  • others 25

Per the no-masking-CI-debt directive: fix for real in batches (per-linter batch PRs work well; godot and fieldalignment are highly mechanical), no only-new-issues, no blanket nolint. Suggest sequence: gosec + errorlint + noctx first (correctness/security value), then staticcheck/unparam/gocritic, then the mechanical godot/misspell/fieldalignment sweeps.

Also noted while in there: the "Security Scanning" job failure on main should clear once the pgx v5.9.2 bump from #1339 merges; re-check after merge for any additional CVEs.

Activity

  1. cristim commented on Jul 3, 2026

    @cristim
    MemberAuthor

    Scope addition discovered during LeanerCloud/cloud-commitments-go#27 phase-2 work: the providers/aws module carries its own golangci debt - 134 issues in providers/aws/recommendations alone (misspell 57, godot 28, gocritic 24, govet ~17, staticcheck 1, plus a few others). Two specific items worth calling out for the batch fix: (1) the lenient parseFloat in recommendations/utilization.go silently returns 0 with a warning on unparseable CE numbers - a no-silent-fallback violation on a money path; the new strict parseSPFloat in sp_coverage.go is the pattern to migrate call sites to. (2) recommendations now has four near-identical rate-limited retry wrappers (fetchCoveragePage, fetchUtilizationPage, fetchSPCoveragePage, fetchSPUtilizationPage) - extract a generic fetchWithRetry helper as part of the cleanup. Note CI currently lints only the root module, so this debt is invisible to the gate; the burn-down should either extend CI to all modules or note why not.

  2. cristim commented on Jul 16, 2026

    @cristim
    MemberAuthor

    Resolved by #1364 (merged): all golangci-lint findings cleared, Lint Code is green on main and now a hard gate. Recommend closing (fieldalignment re-enable follow-up tracked separately in #1373).

  3. cristim commented on Jul 27, 2026

    @cristim
    MemberAuthor

    Verification sweep against main (101f099fb) on 2026-07-27 finds this already resolved.
    Lint Code is green on main.
    Evidence: commit caafb6e (PR #1364). Note the fieldalignment re-enable is tracked separately in #1373.
    Recommending close.

  4. cristim commented on Sep 27, 2026

    @cristim
    MemberAuthor

    Closing as resolved, not splitting into per-repo issues.

    This issue was filed to track "2,769 remaining non-errcheck golangci findings keeping Lint Code red" repo-wide. That problem is fixed: PR #1364 ("chore(lint): clear all golangci-lint findings to green", merged 2026-07-16) cleared all findings, and two prior comments on this issue (2026-07-16, 2026-07-27) already recommended closing it as resolved. Re-verified live just now: gh run list -R LeanerCloud/cloud-commitments-cli --branch main shows the CI workflow (which includes the "Lint Code" job) green on the latest run against main as of 2026-09-27T20:57Z. Given that, filing "burn down 2,769 findings, Lint Code red" issues into the other three post-split repos would put stale, false information into their trackers, so I'm not doing that.

    There is one genuine residual gap, called out in the third comment on this issue: providers/aws is its own Go module (separate go.mod), and golangci-lint-action in ci.yml only lints the root module, so debt in providers/aws is invisible to the "Lint Code" gate that this issue's fix made green. That module now lives in cloud-commitments-go, so I've filed a focused follow-up there instead of a monorepo-wide sibling: LeanerCloud/cloud-commitments-go#120. The fieldalignment re-enable follow-up mentioned in the resolution comments is already tracked separately at #1373 and is out of scope here.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions