From 81c1a368d0ecd00da480f7cfd3ee146f1b0b306f Mon Sep 17 00:00:00 2001 From: clawbot Date: Fri, 7 Aug 2026 20:56:53 +0000 Subject: [PATCH] golangci: set canonical config to the org-standard v2 file, note v2.12.2 --- .golangci.yml | 23 ++++------------------- TODO.md | 11 +++++------ 2 files changed, 9 insertions(+), 25 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 08a1e63..26b1610 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,5 +1,9 @@ version: "2" +# Config schema uses the golangci-lint v2 layout (settings live under +# linters.settings, not top-level linters-settings) so that the +# thresholds below are actually applied by golangci-lint >= v2. + run: timeout: 5m modules-download-mode: readonly @@ -12,7 +16,6 @@ linters: - depguard # Dependency allow/block lists - godot # Requires comments to end with periods - wsl # Deprecated, replaced by wsl_v5 - - gomodguard # Deprecated, replaced by gomodguard_v2 - wrapcheck # Too verbose for internal packages - varnamelen # Short names like db, id are idiomatic Go settings: @@ -25,25 +28,7 @@ linters: max-complexity: 15 dupl: threshold: 100 - exclusions: - generated: lax - paths: - - third_party$ - - builtin$ - - examples$ issues: max-issues-per-linter: 0 max-same-issues: 0 - -formatters: - enable: - - gofmt - - gofumpt - - goimports - exclusions: - generated: lax - paths: - - third_party$ - - builtin$ - - examples$ diff --git a/TODO.md b/TODO.md index 4ef9d5b..fac919c 100644 --- a/TODO.md +++ b/TODO.md @@ -21,12 +21,11 @@ fmt-check, and commit. # Completed Steps -- 2026-08-07: Migrated the canonical `.golangci.yml` to the golangci-lint v2 - schema via `golangci-lint migrate` under v2.12.2 (settings under - `linters.settings`, explicit `exclusions` and `formatters` blocks, - `gomodguard` disabled in favor of `gomodguard_v2`; `gci` intentionally not - enabled). Recorded the canonical golangci-lint version (v2.12.2, - commit-pinned) in REPO_POLICIES.md. +- 2026-08-07: Set the canonical `.golangci.yml` to the org-standard v2-schema + config already deployed byte-identical across the org's Go repos (settings + under `linters.settings` so thresholds like lll/funlen/cyclop/dupl actually + apply under golangci-lint v2). Recorded the canonical golangci-lint version + (v2.12.2, commit-pinned) in REPO_POLICIES.md. - 2026-03-20: Strengthened constructor naming and Params struct rules in the Go styleguide. - 2026-03-18: Documented fail-fast Dockerfile lint stage and conditional -v test