Update golangci-lint to v2.12.2 with canonical config #2

Open
clawbot wants to merge 1 commits from clawbot/bsdaily:golangci-v2.12.2 into main
First-time contributor

Adds the canonical .golangci.yml (v2 layout, default: all with the standard disable list) and pins golangci-lint v2.12.2 everywhere it is referenced.

Version pins

  • Makefile deps target: go install now uses github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.12.2, replacing @latest on the old v1 module path.
  • Dockerfile lint stage already pinned golangci/golangci-lint:v2.12.2-alpine by digest; unchanged.
  • script/bootstrap installs golangci-lint via the system package manager (nix/brew/apk) and carries no version pin; unchanged.

Lint fixes

The repo previously had no .golangci.yml, so the strict config surfaced 174 issues, all fixed with no behavior changes:

  • err113 (12): wrapped static sentinel errors instead of dynamic fmt.Errorf
  • gocognit/funlen/nestif: split ExtractDay, Run, DumpAndCompress, VerifyOutput, and CLI date parsing into smaller helpers
  • noctx (10): ExecContext/QueryContext/QueryRowContext/BeginTx and exec.CommandContext
  • noinlineerr (42) and wsl_v5 (46)/nlreturn (16): statement layout fixes
  • lll (24): wrapped long lines and SQL strings
  • gosec (11): filepath.Clean on opens/creates, bounded uint64 conversion in CheckFreeSpace, named output-dir permission constant
  • mnd (4): unix.FADV_SEQUENTIAL/unix.FADV_WILLNEED and named constants
  • revive (11): package and exported symbol comments
  • testpackage/paralleltest: smoke test moved to bsdaily_test with t.Parallel()
  • nonamedreturns (2), unqueryvet (7), gochecknoglobals (1)

Remaining //nolint directives, each justified inline: gosec G204 for the sqlite3/zstdmt/zstdcat/head subprocesses (internally constructed paths and fixed arguments), and unqueryvet for the intentional full-row SELECT * copies whose schema is defined by the source database.

TODO.md Completed Steps updated. make check is green.

Adds the canonical `.golangci.yml` (v2 layout, `default: all` with the standard disable list) and pins golangci-lint v2.12.2 everywhere it is referenced. ## Version pins - `Makefile` `deps` target: `go install` now uses `github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.12.2`, replacing `@latest` on the old v1 module path. - `Dockerfile` lint stage already pinned `golangci/golangci-lint:v2.12.2-alpine` by digest; unchanged. - `script/bootstrap` installs golangci-lint via the system package manager (nix/brew/apk) and carries no version pin; unchanged. ## Lint fixes The repo previously had no `.golangci.yml`, so the strict config surfaced 174 issues, all fixed with no behavior changes: - `err113` (12): wrapped static sentinel errors instead of dynamic `fmt.Errorf` - `gocognit`/`funlen`/`nestif`: split `ExtractDay`, `Run`, `DumpAndCompress`, `VerifyOutput`, and CLI date parsing into smaller helpers - `noctx` (10): `ExecContext`/`QueryContext`/`QueryRowContext`/`BeginTx` and `exec.CommandContext` - `noinlineerr` (42) and `wsl_v5` (46)/`nlreturn` (16): statement layout fixes - `lll` (24): wrapped long lines and SQL strings - `gosec` (11): `filepath.Clean` on opens/creates, bounded `uint64` conversion in `CheckFreeSpace`, named output-dir permission constant - `mnd` (4): `unix.FADV_SEQUENTIAL`/`unix.FADV_WILLNEED` and named constants - `revive` (11): package and exported symbol comments - `testpackage`/`paralleltest`: smoke test moved to `bsdaily_test` with `t.Parallel()` - `nonamedreturns` (2), `unqueryvet` (7), `gochecknoglobals` (1) Remaining `//nolint` directives, each justified inline: `gosec` G204 for the sqlite3/zstdmt/zstdcat/head subprocesses (internally constructed paths and fixed arguments), and `unqueryvet` for the intentional full-row `SELECT *` copies whose schema is defined by the source database. `TODO.md` Completed Steps updated. `make check` is green.
clawbot added 1 commit 2026-08-07 19:00:01 +02:00
Update golangci-lint to v2.12.2 with canonical config
Some checks are pending
check / check (pull_request) Blocked by required conditions
72d052eac3
Add the canonical .golangci.yml (v2 layout, default: all with the
standard disable list) and pin golangci-lint v2.12.2 in the Makefile
deps target using the v2 module path, replacing the @latest install on
the old v1 path. The Dockerfile lint stage already pinned the v2.12.2
alpine image by digest and is unchanged.

Fix all issues surfaced by the strict config:

- err113: introduce wrapped static sentinel errors
- gocognit/funlen/nestif: split ExtractDay, Run, DumpAndCompress,
  VerifyOutput, and the CLI flag parsing into smaller helpers
- noctx: use ExecContext/QueryContext/BeginTx and CommandContext
- noinlineerr: replace inline if-err assignments with plain ones
- wsl_v5/nlreturn: add required blank lines
- lll: wrap long lines and SQL strings
- gosec: filepath.Clean on file open/create; bounded uint64
  conversion in CheckFreeSpace; named output dir permission constant
- mnd: use unix.FADV_* constants and named size constants
- revive: add package and exported symbol comments
- testpackage/paralleltest: move smoke test to bsdaily_test with
  t.Parallel()
- nonamedreturns: drop non-error named returns

The remaining nolint directives (gosec subprocess launches with
internal paths, unqueryvet full-row SELECT * copies whose schema is
defined by the source database) are each justified inline.
Some checks are pending
check / check (pull_request) Blocked by required conditions
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u golangci-v2.12.2:clawbot-golangci-v2.12.2
git checkout clawbot-golangci-v2.12.2
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/bsdaily#2