From b70fa899cb02cc1b44ca5b757004da7f0c2c577f Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 17 Jun 2026 16:34:22 +0200 Subject: [PATCH] golangci-lint: enable gci formatter (#4828) This allows linting the imports to be grouped correctly, and provides an auto-fix (`golangci-lint run --fix`). Signed-off-by: Sebastiaan van Stijn --- .golangci.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index 9093acb66..422a7448a 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -70,7 +70,6 @@ linters: # - godot # - godox # - goerr113 -# - goimports # we're using gosimports now instead to account for extra whitespaces (see https://github.com/golang/go/issues/20818) # - golint # deprecated # - gomnd # this is too aggressive # - interfacer # this is a good idea, but is no longer supported and is prone to false positives @@ -96,11 +95,18 @@ issues: formatters: enable: + - gci - gofmt - - goimports exclusions: generated: lax paths: - third_party$ - builtin$ - examples$ + settings: + gci: + # See https://golangci-lint.run/docs/formatters/configuration/#gci + sections: + - standard # Standard section: captures all standard packages. + - default # Default section: contains all imports that could not be matched to another section type. + - prefix(github.com/anchore)