github.com/lovung/GoCleanArchitecture@v0.0.0-20210302152432-50d91fd29f9f/.golangci.yaml (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 exhaustive: 13 default-signifies-exhaustive: false 14 funlen: 15 lines: 100 16 statements: 50 17 goconst: 18 min-len: 2 19 min-occurrences: 2 20 gocritic: 21 enabled-tags: 22 - diagnostic 23 - experimental 24 - opinionated 25 - performance 26 - style 27 disabled-checks: 28 - dupImport # https://github.com/go-critic/go-critic/issues/845 29 - ifElseChain 30 - octalLiteral 31 - whyNoLint 32 - wrapperFunc 33 gocyclo: 34 min-complexity: 15 35 goimports: 36 local-prefixes: github.com/golangci/golangci-lint 37 golint: 38 min-confidence: 0 39 gomnd: 40 settings: 41 mnd: 42 # don't include the "operation" and "assign" 43 checks: argument,case,condition,return 44 # govet: 45 # check-shadowing: true 46 # settings: 47 # printf: 48 # funcs: 49 # - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof 50 # - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf 51 # - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf 52 # - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf 53 lll: 54 line-length: 140 55 maligned: 56 suggest-new: true 57 misspell: 58 locale: US 59 nolintlint: 60 allow-leading-space: true # don't require machine-readable nolint directives (i.e. with no leading space) 61 allow-unused: false # report any unused nolint directives 62 require-explanation: false # don't require an explanation for nolint directives 63 require-specific: false # don't require nolint directives to be specific about which linter is being skipped 64 65 linters: 66 # please, do not use `enable-all`: it's deprecated and will be removed soon. 67 # inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint 68 disable-all: true 69 enable: 70 - bodyclose 71 - deadcode 72 - depguard 73 - dogsled 74 - funlen 75 - goconst 76 - gocritic 77 - gocyclo 78 - gofmt 79 - goimports 80 - golint 81 - gomnd 82 - gosec 83 - gosimple 84 - govet 85 - ineffassign 86 - interfacer 87 - lll 88 - misspell 89 - nakedret 90 - rowserrcheck 91 - staticcheck 92 - structcheck 93 - stylecheck 94 - typecheck 95 - unconvert 96 - unparam 97 - unused 98 - varcheck 99 - whitespace 100 101 # don't enable: 102 # - asciicheck 103 # - exhaustive (TODO: enable after next release; current release at time of writing is v1.27) 104 # - gochecknoglobals 105 # - gocognit 106 # - godot 107 # - godox 108 # - goerr113 109 # - maligned 110 # - nestif 111 # - noctx (TODO: enable after next release; current release at time of writing is v1.27) 112 # - prealloc 113 # - testpackage 114 # - wsl 115 116 issues: 117 # Excluding configuration per-path, per-linter, per-text and per-source 118 exclude-rules: 119 - path: _test\.go 120 linters: 121 - gomnd 122 - funlen 123 - lll 124 - goconst 125 126 # https://github.com/go-critic/go-critic/issues/926 127 - linters: 128 - gocritic 129 text: "unnecessaryDefer:" 130 131 - linters: 132 - gocritic 133 text: "hugeParam:" 134 135 - text: "G401" 136 linters: 137 - gosec 138 - text: "G501" 139 linters: 140 - gosec 141 - text: "G601" 142 linters: 143 - gosec 144 145 146 147 run: 148 skip-dirs: 149 - test 150 - databases 151 152 skip-files: 153 - routers/commentsRouter_controllers.go 154 155 # golangci.com configuration 156 # https://github.com/golangci/golangci/wiki/Configuration 157 service: 158 golangci-lint-version: 1.23.x # use the fixed version to not introduce new linters unexpectedly 159 prepare: 160 - echo "here I can run custom commands, but no preparation needed for this repo"