Skip to content

chore(lint): fix golangci-lint findings and run lint in CI (#192) - #196

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/192
Oct 15, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/192

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Fixes #192

What

  • Lint findings fixed (10, not 7). golangci-lint's default max-same-issues: 3 hid two more unchecked Fprintln calls in the table renderer and one in cmd/app.go. --max-same-issues=0 --max-issues-per-linter=0 now reports 0.
    • pkg/output/printer.go: fmt.Fprintln(os.Stdout, …) → fmt.Println(…), the idiom the rest of the file uses (byte-identical output). The ANSI-terminator scan is De Morgan'd (QF1001).
    • cmd/app.go (tabwriter: write errors show up at Flush, which is already returned) and cmd/gendocs.go: _, _ =, as in cmd/available.go and pkg/progress.
    • cmd/root.go: tagged switch (QF1002).
  • CI Lint job. Runs make lint, so CI uses the same golangci config contributors use. There isn't one today, so built-in defaults apply. A root .golangci.yml would be picked up automatically. golangci-lint is pinned to 2.14.0, and its tarball is checked against a SHA256 pinned in the workflow. This follows the same convention as spawn's gitleaks install. The hash was cross-checked against golangci-lint-2.14.0-checksums.txt and against a local download.
  • Makefile: GOLANGCI_LINT_VERSION=2.14.0. The install hint now installs that exact version instead of master's script. make lint warns if your local version differs from the pin.

Tests

  • stripAnsiCodes boundary cases: A/Z/a/z terminators, the non-letters next to them (@ [ \ {`), and an unterminated escape. A mutation test confirmed they catch an off-by-one in the rewritten condition.
  • internal/hygiene: TestCIGatesLint checks that CI runs make lint with a pinned version and a pinned SHA256 check.
  • make test, make lint (0 issues), make check-fmt, make check-docs, and scripts/verify-pins.sh all pass locally.

@codecov

codecov Bot commented Oct 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/root.go 0.00% 3 Missing ⚠️
cmd/gendocs.go 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

make lint on main reported 7 findings with golangci-lint 2.14.0 -- really 10:
the default max-same-issues=3 hid two more unchecked Fprintln calls in the
same table renderer, and one more in cmd/app.go.

- pkg/output/printer.go: fmt.Fprintln(os.Stdout, ...) -> fmt.Println(...),
  the idiom the rest of the file already uses (identical output). De Morgan
  the ANSI-terminator scan; boundary tests pin both ends of both letter
  ranges and the adjacent non-letters.
- cmd/app.go (tabwriter, errors surface at Flush) and cmd/gendocs.go:
  `_, _ =` as cmd/available.go and pkg/progress already do.
- cmd/root.go: tagged switch on arg.

CI: new Lint job runs `make lint` (so whatever golangci config the repo has
is the one that gates; none today, i.e. defaults) with golangci-lint pinned
to 2.14.0 and the tarball verified against a pinned SHA256, matching spawn's
gitleaks install. A hygiene test keeps the step, the pin and the hash check
from being dropped. `make lint` warns on a local version mismatch.

Fixes #192
@scttfrdmn
scttfrdmn merged commit 6088635 into main Oct 15, 2026
6 checks passed
@scttfrdmn
scttfrdmn deleted the fix/192 branch October 15, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

make lint fails on main (7 findings), and CI doesn't run lint

1 participant