version: "2" output: formats: text: path: stdout linters: default: none enable: - bodyclose - copyloopvar - dogsled - errcheck - errorlint - exhaustive - funlen - goconst - gocritic - gocyclo - govet - ineffassign - lll - nakedret - revive - staticcheck - unparam - unused - whitespace settings: dupl: threshold: 100 errcheck: check-blank: true funlen: lines: 500 statements: 50 goconst: min-len: 3 min-occurrences: 3 gocritic: disabled-checks: - whyNoLint enabled-tags: - diagnostic - experimental - opinionated - performance - style gocyclo: min-complexity: 25 govet: enable: - shadow lll: line-length: 160 revive: rules: - name: blank-imports - name: context-as-argument - name: context-keys-type - name: dot-imports - name: error-return - name: error-strings - name: error-naming - name: exported - name: increment-decrement - name: var-naming - name: var-declaration - name: package-comments - name: range - name: receiver-naming - name: time-naming - name: unexported-return - name: indent-error-flow - name: errorf - name: empty-block - name: superfluous-else - name: unreachable-code - name: redefines-builtin-id # While we agree with this rule, right now it would break too many # projects. So, we disable it by default. - name: unused-parameter disabled: true exclusions: generated: lax presets: - comments - common-false-positives - legacy - std-error-handling rules: - linters: - errcheck - funlen - gochecknoglobals # Globals in test files are tolerated. - goconst # Repeated consts in test files are tolerated. - gocritic - gocyclo - gosec path: _test\.go # This rule is buggy and breaks on our `///Block` lines. Disable for now. - linters: - gocritic text: 'commentFormatting: put a space' # This rule incorrectly flags nil references after assert.Assert(t, x != nil) - linters: - staticcheck path: _test\.go text: SA5011 - linters: - lll source: '^//go:generate ' - linters: - gocritic - lll path: \.resolvers\.go source: '^func \(r \*[a-zA-Z]+Resolvers\) ' - path: (.+)\.go$ # We allow error shadowing text: declaration of "err" shadows declaration at paths: - third_party$ - builtin$ - examples$ formatters: enable: - gofmt - goimports exclusions: generated: lax paths: - third_party$ - builtin$ - examples$