diff --git a/AGENTS.md b/AGENTS.md index 86d33f3ff..909c183c1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -310,8 +310,9 @@ a broken one. - **Protobuf regeneration**: changes under `proto/` require `make generate` (which runs `buf generate`) and should land in a **separate commit** from the callers that use the regenerated types. -- **Formatting** is enforced by `golangci-lint` with `golines` (width 88) - and `gofumpt`. Run `make fmt` or rely on the pre-commit hook. +- **Formatting** is enforced by the `golangci-lint` formatters in + `.golangci.yaml` (`gofumpt`, `gci`, `goimports`). No line-length limit is + enforced. Run `make fmt` or rely on the pre-commit hook. - **Logging** uses `zerolog`. Prefer single-line chains (`log.Info().Str(...).Msg(...)`). For 4+ fields or conditional fields, build incrementally and **reassign** the event variable: diff --git a/README.md b/README.md index c18bf2ad5..c3a854f0a 100644 --- a/README.md +++ b/README.md @@ -107,8 +107,8 @@ To ensure we have some consistency with a growing number of contributions, this project has adopted linting and style/formatting rules: The **Go** code is linted with [`golangci-lint`](https://golangci-lint.run) and -formatted with [`golines`](https://github.com/segmentio/golines) (width 88) and -[`gofumpt`](https://github.com/mvdan/gofumpt). +formatted with the `golangci-lint` formatters +([`gofumpt`](https://github.com/mvdan/gofumpt), `gci`, `goimports`). Please configure your editor to run the tools while developing and make sure to run `make lint` and `make fmt` before committing any code. diff --git a/flake.nix b/flake.nix index a9e83e004..280baadff 100644 --- a/flake.nix +++ b/flake.nix @@ -86,10 +86,6 @@ buildGoModule = buildGo; }; - golines = prev.golines.override { - buildGoModule = buildGo; - }; - # goimports and friends: they parse Go with the parser of the Go # they were built with, so an older one rejects new syntax. gotools = prev.gotools.override { @@ -123,7 +119,6 @@ ++ [ golangci-lint golangci-lint-langserver - golines prettier nixfmt goreleaser @@ -217,12 +212,12 @@ } ); - # Full-tree golangci-lint (golines, gofumpt, etc.); uses the overlay's + # Full-tree golangci-lint (gofumpt, gci, etc.); uses the overlay's # golangci-lint built against the pinned Go. golangci-lint = fc.goLint common; # nixfmt + prettier, excluding generated output. goFmt = "off": - # Go formatting (golines, gofumpt) is enforced by the golangci-lint + # Go formatting (gofumpt, gci) is enforced by the golangci-lint # check, not treefmt. prettierExts matches the old prettier-lint glob # (no json: testdata fixtures are hand-formatted). formatting = fc.goFormat (