Add .editorconfig and the standard .golangci.yml #59

Closed
opened 2026-07-26 20:12:23 +02:00 by clawbot · 3 comments
Collaborator

vaultik is missing .editorconfig and .golangci.yml, diverging from our standard Go repo config.

Definition of done

  1. Add a standard .editorconfig matching our other Go repos (e.g. sneak/dnswatcher).
  2. Add .golangci.yml matching the org-standard config (byte-identical to sneak/dnswatcher's).
  3. make check and docker build . are green under the new config. If adding the linter surfaces findings, remediate them BEHAVIOR-PRESERVINGLY. If the remediation is large (more than ~50 findings), STOP and report so the lint cleanup can be split into its own issue/PR rather than bundled here.

The finishing commit's title must end with (closes #N) referencing this issue.

vaultik is missing `.editorconfig` and `.golangci.yml`, diverging from our standard Go repo config. ## Definition of done 1. Add a standard `.editorconfig` matching our other Go repos (e.g. `sneak/dnswatcher`). 2. Add `.golangci.yml` matching the org-standard config (byte-identical to `sneak/dnswatcher`'s). 3. `make check` and `docker build .` are green under the new config. If adding the linter surfaces findings, remediate them BEHAVIOR-PRESERVINGLY. If the remediation is large (more than ~50 findings), STOP and report so the lint cleanup can be split into its own issue/PR rather than bundled here. The finishing commit's title must end with ` (closes #N)` referencing this issue.
Author
Collaborator

Update after attempting this: the two files add trivially (both fetched byte-for-byte from sneak/dnswatcher), but enabling the org-standard .golangci.yml (linters: default: all) surfaces ~2,990 lint findings across 40+ linters on vaultik (wsl 1050, nlreturn 378, noinlineerr 373, revive 143, paralleltest 138, gosec 73, and many more). That is far beyond a behavior-preserving overnight cleanup and needs real judgment (per-finding //nolint vs refactor, or tuning which linters the shared config disables). So .editorconfig and .golangci.yml are effectively coupled to a large lint cleanup and can't land green together as a small change.

Proposed split:

  1. I'll land .editorconfig now as a small standalone PR (independent and safe).
  2. The .golangci.yml adoption plus the lint cleanup is a separate, larger tracked effort — your call whether to do the full behavior-preserving cleanup, or tune the shared .golangci.yml to something less brutal for existing code. Assigning to you for that decision.

Side note: golangci-lint 2.12 flags gomodguard as deprecated in the shared config — a separate org-wide freshness nit worth a follow-up.

Update after attempting this: the two files add trivially (both fetched byte-for-byte from `sneak/dnswatcher`), but enabling the org-standard `.golangci.yml` (`linters: default: all`) surfaces ~2,990 lint findings across 40+ linters on vaultik (`wsl` 1050, `nlreturn` 378, `noinlineerr` 373, `revive` 143, `paralleltest` 138, `gosec` 73, and many more). That is far beyond a behavior-preserving overnight cleanup and needs real judgment (per-finding `//nolint` vs refactor, or tuning which linters the shared config disables). So `.editorconfig` and `.golangci.yml` are effectively coupled to a large lint cleanup and can't land green together as a small change. Proposed split: 1. I'll land `.editorconfig` now as a small standalone PR (independent and safe). 2. The `.golangci.yml` adoption plus the lint cleanup is a separate, larger tracked effort — your call whether to do the full behavior-preserving cleanup, or tune the shared `.golangci.yml` to something less brutal for existing code. Assigning to you for that decision. Side note: golangci-lint 2.12 flags `gomodguard` as deprecated in the shared config — a separate org-wide freshness nit worth a follow-up.
sneak was assigned by clawbot 2026-07-26 20:54:08 +02:00
sneak referenced this issue from a commit 2026-07-26 21:03:47 +02:00
Author
Collaborator

Plan for finishing this issue:

  1. .editorconfig is already done — landed in 928c389 (PR #60) and is
    byte-identical to the canonical copy in the vendored policy set in
    sneak/prompts.
  2. Add .golangci.yml, copied byte-for-byte from the vendored policy set
    in sneak/prompts (which now disables the deprecated wsl linter,
    among others), on a feature branch.
  3. Run make check under the new config and count findings:
    • If the findings are few, fix them behavior-preservingly in small
      commits on the same branch.
    • If they are extensive (dozens or more, per the definition of done
      here), land the config anyway with the count and per-linter
      breakdown posted here, and file a follow-up issue for the
      remediation with its own definition of done, rather than doing a
      mass rewrite now.
  4. Run make fmt, merge to main, and push. The finishing commit title
    ends with (closes #59) only if make check is actually green with
    the new config in place; otherwise this issue stays open pending the
    follow-up.

Note: the known org-wide gomodguard deprecation warning under
golangci-lint 2.12.x may appear; it is tracked separately and will not be
chased here.

Plan for finishing this issue: 1. `.editorconfig` is already done — landed in 928c389 (PR #60) and is byte-identical to the canonical copy in the vendored policy set in `sneak/prompts`. 2. Add `.golangci.yml`, copied byte-for-byte from the vendored policy set in `sneak/prompts` (which now disables the deprecated `wsl` linter, among others), on a feature branch. 3. Run `make check` under the new config and count findings: - If the findings are few, fix them behavior-preservingly in small commits on the same branch. - If they are extensive (dozens or more, per the definition of done here), land the config anyway with the count and per-linter breakdown posted here, and file a follow-up issue for the remediation with its own definition of done, rather than doing a mass rewrite now. 4. Run `make fmt`, merge to `main`, and push. The finishing commit title ends with `(closes #59)` only if `make check` is actually green with the new config in place; otherwise this issue stays open pending the follow-up. Note: the known org-wide `gomodguard` deprecation warning under golangci-lint 2.12.x may appear; it is tracked separately and will not be chased here.
Author
Collaborator

Status: the standard .golangci.yml has landed on main
(928c389..23d22a0). Source: copied byte-for-byte from the vendored
policy set in sneak/prompts (verified identical with cmp), per the
policy that agents never modify it. .editorconfig was already in place
from PR #60 and matches the canonical copy exactly, so both files from
the definition of done are now present.

What landed:

  • 23d22a0 — Add standard .golangci.yml (refs #59), plus the
    TODO.md workflow update.
  • c9c72efscript/bootstrap now installs sqlite3: the test suite
    shells out to it for VACUUM, but bootstrap didn't install it, so
    make test failed on a fresh environment. Fixed in passing since a
    green make test is a prerequisite for this issue's definition of
    done.

Lint status under the new config: 2,990 findings — far past the ~50
threshold in the definition of done, so per the split decided above the
remediation is NOT bundled here. It is tracked in #61 with the full
per-linter breakdown (top offenders: wsl_v5 1050, nlreturn 378,
noinlineerr 373, revive 143, paralleltest 138, err113 123) and a
behavior-preserving definition of done. make test and make fmt-check
are green; only make lint is red.

Consequences until #61 is done: make check, and therefore
docker build . and CI, are red on main. This issue stays open — the
finishing commit deliberately says refs #59, not closes #59, because
the repo is not green under the new config yet. #61's definition of done
ends with closing this issue.

Confirmed: the known org-wide gomodguard deprecation warning appears
under golangci-lint 2.12.2 (replaced by gomodguard_v2). Not chased
here per the standing decision; it needs a canonical-config update in
sneak/prompts.

Status: the standard `.golangci.yml` has landed on `main` (928c389..23d22a0). Source: copied byte-for-byte from the vendored policy set in `sneak/prompts` (verified identical with `cmp`), per the policy that agents never modify it. `.editorconfig` was already in place from PR #60 and matches the canonical copy exactly, so both files from the definition of done are now present. What landed: - `23d22a0` — Add standard `.golangci.yml` (refs #59), plus the `TODO.md` workflow update. - `c9c72ef` — `script/bootstrap` now installs `sqlite3`: the test suite shells out to it for `VACUUM`, but bootstrap didn't install it, so `make test` failed on a fresh environment. Fixed in passing since a green `make test` is a prerequisite for this issue's definition of done. Lint status under the new config: **2,990 findings** — far past the ~50 threshold in the definition of done, so per the split decided above the remediation is NOT bundled here. It is tracked in #61 with the full per-linter breakdown (top offenders: `wsl_v5` 1050, `nlreturn` 378, `noinlineerr` 373, `revive` 143, `paralleltest` 138, `err113` 123) and a behavior-preserving definition of done. `make test` and `make fmt-check` are green; only `make lint` is red. Consequences until #61 is done: `make check`, and therefore `docker build .` and CI, are red on `main`. This issue stays open — the finishing commit deliberately says `refs #59`, not `closes #59`, because the repo is not green under the new config yet. #61's definition of done ends with closing this issue. Confirmed: the known org-wide `gomodguard` deprecation warning appears under golangci-lint 2.12.2 (`replaced by gomodguard_v2`). Not chased here per the standing decision; it needs a canonical-config update in `sneak/prompts`.
clawbot added this to the 1.0.0 milestone 2026-08-09 03:35:42 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/vaultik#59