# Linter definitions should be sorted in alphabetical order by name version: "2" run: allow-parallel-runners: true linters: default: all disable: # gomodguard is better - depguard # always check marshal errors - errchkjson # triggers on switches with default case. - exhaustive # allow use go default zero values . - exhaustruct # cyclomatic complexity checkers already enforce limit on function length no need to count lines. - funlen # not many cases when this is helpful were observed - mnd # revive warns about this - nakedret # we don't do black box testing in unit tests. - testpackage # having one length vars is fine. - varnamelen settings: # declaration order decorder: dec-order: - const - var - type - func disable-dec-order-check: false disable-init-func-first-check: false errcheck: check-type-assertions: true check-blank: true gocritic: disabled-checks: - unnamedResult # cool idea, quite annoying in practice as nolint directive often requires weird placements to take effect - whyNoLint enabled-tags: - diagnostic - style - performance - experimental - opinionated gocyclo: min-complexity: 10 gomodguard: blocked: modules: - io/ioutil: {} local-replace-directives: false govet: disable: - fieldalignment enable-all: true interfacebloat: max: 6 lll: line-length: 120 tab-width: 4 makezero: always: true revive: severity: error enable-all-rules: true rules: - name: argument-limit arguments: - 5 - name: comment-spacings arguments: - nolint - name: exported arguments: - checkPrivateReceivers - disableStutteringCheck - name: function-result-limit arguments: - 4 - name: max-public-structs arguments: - 5 - name: add-constant disabled: true - name: banned-characters # useless, as every char needs to be configured disabled: true - name: confusing-naming disabled: true # common to have a public faceing signature and internal uglier signature. Walk and walk (for example) - name: confusing-results disabled: true # cyclomatic complexity checks are enough, no need to complicate life with two different metrics for complexity. - name: cognitive-complexity disabled: true - name: cyclomatic disabled: true - name: file-header disabled: true # cool idea, but warning about every bool param is not acceptable - name: flag-parameter disabled: true # cyclomatic complexety checks are enough - name: function-length disabled: true # duplicate - name: line-length-limit disabled: true # duplicate - name: unhandled-error disabled: true # duplicate - name: package-comments disabled: true staticcheck: checks: - all - -ST1000 # Incorrect or missing package comment - -ST1003 # Poorly chosen identifier tagalign: align: false # could be true if https://github.com/momaek/formattag is used. order: - yaml - json - toml - mapstructure - binding - validate # long, flat, ribbon-shaped pasta # also # struct tag naming convention checker tagliatelle: case: rules: avro: snake bson: camel env: upperSnake envconfig: upperSnake json: snake mapstructure: kebab xml: camel yaml: camel wrapcheck: ignore-sigs: - .Errorf( - errors.New( - errors.Unwrap( - .Wrap( - .Wrapf( - .WithMessage( - .WithMessagef( - .WithStack( - errs.New( exclusions: generated: lax rules: - linters: - dupl - err113 - errcheck - gocritic - maintidx - revive - wrapcheck path: _test\.go paths: - third_party$ - builtin$ - examples$ issues: max-issues-per-linter: 0 max-same-issues: 0 severity: default: error formatters: enable: - gci - gofmt exclusions: generated: lax paths: - third_party$ - builtin$ - examples$