Skip to content

golangci-lint is not run in CI, and the root module has 439 findings (errcheck 358, staticcheck 49, unused 32) #1028

Closed

Description

@scttfrdmn

golangci-lint does not run anywhere in spawn's CI, and the root module has a large backlog of findings. Nothing stops the backlog from growing, and anyone who runs it locally gets failures that have nothing to do with their change.

Measured

golangci-lint v2.14.0, built-in default config (spawn has no .golangci.yml), root module (./...), on main at 24892d6:

  • With the default output caps (50 per linter, 3 identical): 107 issues: errcheck 39, staticcheck 36, unused 32
  • Uncapped (--max-issues-per-linter=0 --max-same-issues=0): 439 issues: errcheck 358, staticcheck 49, unused 32
    • errcheck: 320 of the 358 are unchecked fmt.Fprint* (256 Fprintf, 58 Fprintln, 6 Fprint), mostly in cmd/ (333 of all 439 findings are under cmd/). The others are resp.Body.Close, f.Close, os.Setenv in tests, and so on.
    • staticcheck: SA1019 21, QF1001 12, ST1005 6, SA1012 4, S1 3, QF1011 3, SA4023 1, SA4000 1, QF1003 1
    • unused: 32, including several test/e2e/helpers.go helpers
    • 49 of the 439 are in _test.go files.

The nine nested modules (scripts/nested-modules.sh) were not measured.

(The count I was given before measuring was "~42", which is far below either figure. It may have come from a different linter set, version or tree. The numbers above are the ones to start from.)

Relationship to existing work

Suggested

Do what truffle did in spore-host/truffle#196 (for truffle#192):

  1. Add a lint job to .github/workflows/ci.yml that runs make lint (the same target contributors run). Install golangci-lint at a pinned version and pinned SHA-256 (in the workflow, not read from the release's checksums file), the same way spawn's gitleaks install is pinned.
  2. Pin GOLANGCI_LINT_VERSION in the Makefile next to the lint target, and warn locally when the installed version differs.
  3. Before the job can be blocking, either fix the findings or commit a .golangci.yml that narrows the rules deliberately. For example, exclude errcheck on fmt.Fprint* to a terminal writer, which accounts for about 73% of the total. Narrowing a check should be a reviewed decision, not something a default does.
  4. Decide whether the nested modules are linted as well; make check-nested already enumerates them.

Not attempted in the PRs for #1013/#1014. Filed so the backlog has an owner.

Activity

  1. added this to the v0.137.0 milestone on Oct 19, 2026
  2. scttfrdmn commented on Oct 19, 2026

    @scttfrdmn
    ContributorAuthor

    Decision needed (milestone planning, 2026-10-18): fix all 439 golangci-lint findings, or commit a narrowing .golangci.yml and ratchet?

    Default if there's no objection: commit a narrowing config that passes today, run it in CI, and widen it one linter at a time.

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions