diff --git a/.golangci.yml b/.golangci.yml index 92332676c..f36b7edb8 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,4 +1,91 @@ +formatters: + enable: + - gofmt + - goimports + + exclusions: + generated: lax + + settings: + gofmt: + simplify: true + + goimports: + local-prefixes: + - helm.sh/helm/v4 + +linters: + default: none + + enable: + - depguard + - dupl + - gomodguard + - govet + - ineffassign + - misspell + - nakedret + - revive + - staticcheck + - thelper + - unused + - usestdlibvars + + exclusions: + generated: lax + + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + + rules: [] + + warn-unused: true + +linters-settings: + depguard: + rules: + Main: + deny: + - pkg: github.com/hashicorp/go-multierror + desc: "use errors instead" + - pkg: github.com/pkg/errors + desc: "use errors instead" + + dupl: + threshold: 400 + + gomodguard: + blocked: + modules: + - github.com/evanphx/json-patch: + recommendations: + - github.com/evanphx/json-patch/v5 + +run: + timeout: 10m + +version: "2"formatters: + enable: + - gofmt + - goimports + + exclusions: + generated: lax + + settings: + gofmt: + simplify: true + + goimports: + local-prefixes: + - helm.sh/helm/v4 + linters: + default: none + enable: - depguard - dupl @@ -13,6 +100,19 @@ linters: - unused - usestdlibvars + exclusions: + generated: lax + + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + + rules: [] + + warn-unused: true + linters-settings: depguard: rules: @@ -22,8 +122,10 @@ linters-settings: desc: "use errors instead" - pkg: github.com/pkg/errors desc: "use errors instead" + dupl: threshold: 400 + gomodguard: blocked: modules: @@ -31,7 +133,7 @@ linters-settings: recommendations: - github.com/evanphx/json-patch/v5 -issues: - exclude-use-default: false run: - timeout: 10m \ No newline at end of file + timeout: 10m + +version: "2" \ No newline at end of file