formatters: enable: - gofmt - goimports settings: gci: sections: - prefix(github.com/golangci/golangci-lint) goimports: local-prefixes: - github.com/golangci/golangci-lint linters: default: none enable: - asciicheck - bodyclose # - deadcode - depguard # - dogsled # - dupl # - errcheck # - exhaustive # - funlen # - gochecknoglobals # - gochecknoinits # - gocognit # - goconst # - gocritic # - gocyclo # - godot # - godox # - goerr113 # - gomnd - goprintffuncname # - gosec # - gosimple # - govet # - ineffassign # - interfacer # - lll # - maligned # - misspell - nakedret # - nestif # - noctx # - nolintlint # - prealloc - rowserrcheck # - revive # - scopelint # - staticcheck # - structcheck # - stylecheck # - testpackage # - typecheck - unconvert # - unparam # - unused # - varcheck # - whitespace # - wsl exclusions: paths: - test/testdata_etc - internal/cache - internal/renameio - internal/robustio rules: - path: _test\.go linters: - gomnd - path: pkg/golinters/errcheck.go text: "SA1019: errCfg.Exclude is deprecated: use ExcludeFunctions instead" - path: pkg/commands/run.go text: "SA1019: lsc.Errcheck.Exclude is deprecated: use ExcludeFunctions instead" # TODO must be removed after the release of the next version (v1.41.0) - path: pkg/commands/run.go linters: - gomnd # TODO must be removed after the release of the next version (v1.41.0) - path: pkg/golinters/nolintlint/nolintlint.go linters: - gomnd # TODO must be removed after the release of the next version (v1.41.0) - path: pkg/printers/tab.go linters: - gomnd settings: govet: enable: - shadow settings: printf: funcs: - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf lll: line-length: 140 depguard: rules: main: list-mode: strict deny: - pkg: github.com/sirupsen/logrus desc: "logging is allowed only by logutils.Log" dupl: threshold: 100 funlen: lines: 100 statements: 50 goconst: min-len: 2 min-occurrences: 2 gocritic: enabled-tags: - diagnostic - experimental - opinionated - performance - style disabled-checks: - dupImport # https://github.com/go-critic/go-critic/issues/845 - ifElseChain - octalLiteral - whyNoLint - wrapperFunc gocyclo: min-complexity: 15 misspell: locale: US mnd: checks: - argument - case - condition - return nolintlint: allow-unused: false # report any unused nolint directives require-explanation: false # don't require an explanation for nolint directives require-specific: false # don't require nolint directives to be specific about which linter is being skipped version: "2"