From 36013b246a31ee95c646d60730b05158c7537102 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Mon, 1 Dec 2025 15:36:14 +0800 Subject: [PATCH] build: configure golangci-lint with custom rules and exclusions - Add golangci-lint configuration with a custom set of enabled linters and formatters - Exclude generated files and specific directories from linting and formatting Signed-off-by: Bo-Yi Wu --- .golangci.yml | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .golangci.yml diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..be64c01 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,51 @@ +version: "2" +linters: + default: none + enable: + - bodyclose + - dogsled + - dupl + - errcheck + - exhaustive + - gochecknoinits + - goconst + - gocritic + - gocyclo + - goprintffuncname + - gosec + - govet + - ineffassign + - lll + - misspell + - nakedret + - noctx + - nolintlint + - rowserrcheck + - staticcheck + - unconvert + - unparam + - unused + - whitespace + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + paths: + - third_party$ + - builtin$ + - examples$ +formatters: + enable: + - gofmt + - gofumpt + - goimports + - golines + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$