github.com/nakabonne/golangci-lint@v1.26.1/.golangci.yml (about) 1 linters-settings: 2 depguard: 3 list-type: blacklist 4 packages: 5 # logging is allowed only by logutils.Log, logrus 6 # is allowed to use only in logutils package 7 - github.com/sirupsen/logrus 8 packages-with-error-message: 9 - github.com/sirupsen/logrus: "logging is allowed only by logutils.Log" 10 dupl: 11 threshold: 100 12 funlen: 13 lines: 100 14 statements: 50 15 goconst: 16 min-len: 2 17 min-occurrences: 2 18 gocritic: 19 enabled-tags: 20 - diagnostic 21 - experimental 22 - opinionated 23 - performance 24 - style 25 disabled-checks: 26 - dupImport # https://github.com/go-critic/go-critic/issues/845 27 - ifElseChain 28 - octalLiteral 29 - whyNoLint 30 - wrapperFunc 31 gocyclo: 32 min-complexity: 15 33 goimports: 34 local-prefixes: github.com/golangci/golangci-lint 35 golint: 36 min-confidence: 0 37 gomnd: 38 settings: 39 mnd: 40 # don't include the "operation" and "assign" 41 checks: argument,case,condition,return 42 govet: 43 check-shadowing: true 44 settings: 45 printf: 46 funcs: 47 - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof 48 - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf 49 - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf 50 - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf 51 lll: 52 line-length: 140 53 maligned: 54 suggest-new: true 55 misspell: 56 locale: US 57 nolintlint: 58 allow-leading-space: true # don't require machine-readable nolint directives (i.e. with no leading space) 59 allow-unused: false # report any unused nolint directives 60 require-explanation: false # don't require an explanation for nolint directives 61 require-specific: false # don't require nolint directives to be specific about which linter is being skipped 62 63 linters: 64 # please, do not use `enable-all`: it's deprecated and will be removed soon. 65 # inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint 66 disable-all: true 67 enable: 68 - bodyclose 69 - deadcode 70 - depguard 71 - dogsled 72 - dupl 73 - errcheck 74 - funlen 75 - gochecknoinits 76 - goconst 77 - gocritic 78 - gocyclo 79 - gofmt 80 - goimports 81 - golint 82 - gomnd 83 - goprintffuncname 84 - gosec 85 - gosimple 86 - govet 87 - ineffassign 88 - interfacer 89 - lll 90 - misspell 91 - nakedret 92 - nolintlint 93 - rowserrcheck 94 - scopelint 95 - staticcheck 96 - structcheck 97 - stylecheck 98 - typecheck 99 - unconvert 100 - unparam 101 - unused 102 - varcheck 103 - whitespace 104 105 # don't enable: 106 # - gochecknoglobals 107 # - gocognit 108 # - godox 109 # - maligned 110 # - prealloc 111 112 issues: 113 # Excluding configuration per-path, per-linter, per-text and per-source 114 exclude-rules: 115 - path: _test\.go 116 linters: 117 - gomnd 118 119 run: 120 skip-dirs: 121 - test/testdata_etc 122 - internal/cache 123 - internal/renameio 124 - internal/robustio 125 126 # golangci.com configuration 127 # https://github.com/golangci/golangci/wiki/Configuration 128 service: 129 golangci-lint-version: 1.23.x # use the fixed version to not introduce new linters unexpectedly 130 prepare: 131 - echo "here I can run custom commands, but no preparation needed for this repo"