github.com/kyma-incubator/compass/components/director@v0.0.0-20230623144113-d764f56ff805/.golangci.yml (about) 1 run: 2 # Use Go 1.17 because of https://github.com/golangci/golangci-lint/issues/2649 3 go: '1.17' 4 5 # default concurrency is a available CPU number 6 concurrency: 4 7 8 # timeout for analysis, e.g. 30s, 5m, default is 1m 9 timeout: 30m 10 11 # exit code when at least one issue was found, default is 1 12 issues-exit-code: 1 13 14 # include test files or not, default is true 15 tests: true 16 17 # which dirs to skip: issues from them won't be reported; 18 # can use regexp here: generated.*, regexp is applied on full path; 19 # default value is empty list, but default dirs are skipped independently 20 # from this option's value (see skip-dirs-use-default). 21 # "/" will be replaced by current OS file path separator to properly work 22 # on Windows. 23 skip-dirs: 24 - automock 25 26 # default is true. Enables skipping of directories: 27 # vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ 28 skip-dirs-use-default: true 29 30 # which files to skip: they will be analyzed, but issues from them 31 # won't be reported. Default value is empty list, but there is 32 # no need to include all autogenerated files, we confidently recognize 33 # autogenerated files. If it's not please let us know. 34 # "/" will be replaced by current OS file path separator to properly work 35 # on Windows. 36 37 # skip-files: 38 # - ".*\\.my\\.go$" 39 # - lib/bad.go 40 41 # by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules": 42 # If invoked with -mod=readonly, the go command is disallowed from the implicit 43 # automatic updating of go.mod described above. Instead, it fails when any changes 44 # to go.mod are needed. This setting is most useful to check that go.mod does 45 # not need updates, such as in a continuous integration and testing system. 46 # If invoked with -mod=vendor, the go command assumes that the vendor 47 # directory holds the correct copies of dependencies and ignores 48 # the dependency descriptions in go.mod. 49 modules-download-mode: readonly 50 51 # Allow multiple parallel golangci-lint instances running. 52 # If false (default) - golangci-lint acquires file lock on start. 53 allow-parallel-runners: false 54 55 56 # output configuration options 57 output: 58 # colored-line-number|line-number|json|tab|checkstyle|code-climate|junit-xml|github-actions 59 # default is "colored-line-number" 60 format: colored-line-number 61 62 # print lines of code with issue, default is true 63 print-issued-lines: true 64 65 # print linter name in the end of issue text, default is true 66 print-linter-name: true 67 68 # make issues output unique by line, default is true 69 uniq-by-line: true 70 71 # add a prefix to the output file references; default is no prefix 72 path-prefix: "" 73 74 # sorts results by: filepath, line and column 75 sort-results: false 76 77 linters: 78 disable-all: true 79 # disable: 80 # - ineffassign 81 # - bodyclose 82 # - cyclop 83 # - dupl 84 # - errname 85 # - errorlint 86 # - exhaustive 87 # - exhaustivestruct 88 # - funlen 89 # - gci 90 # - gochecknoglobals 91 # - gochecknoinits 92 # - gocognit 93 # - gocyclo 94 # - godot 95 # - godox 96 # - goerr113 97 # - gofmt 98 # - gofumpt 99 # - goheader 100 # - goimports 101 # - golint 102 # - gomnd 103 # - gomoddirectives 104 # - gomodguard 105 # - gosec 106 # - interfacer 107 # - lll 108 # - maligned 109 # - nestif 110 # - nlreturn 111 # - noctx 112 # - paralleltest 113 # - scopelint 114 # - tagliatelle 115 # - testpackage TODO: enable 116 # - thelper 117 # - wrapcheck 118 # - wsl 119 enable: 120 - deadcode 121 - errcheck 122 - gosimple 123 - govet 124 - staticcheck 125 - structcheck 126 - typecheck 127 - unused 128 - varcheck 129 - asciicheck 130 - depguard 131 - dogsled 132 - durationcheck 133 - exportloopref 134 - forbidigo 135 - forcetypeassert 136 - goconst 137 - gocritic 138 - goprintffuncname 139 - ifshort 140 - importas 141 - makezero 142 - misspell 143 - nakedret 144 - nilerr 145 - nolintlint 146 - prealloc 147 - predeclared 148 - promlinter 149 - rowserrcheck 150 - sqlclosecheck 151 - tparallel 152 - unconvert 153 - wastedassign 154 - revive 155 - stylecheck 156 - unparam 157 - whitespace 158 # enable-all: true 159 fast: false # Run only fast linters from enabled linters set (first run won't be fast) 160 161 linters-settings: 162 revive: 163 severity: warning 164 # see https://github.com/mgechev/revive#available-rules for details. 165 rules: 166 - name: exported 167 severity: warning 168 169 issues: 170 # # List of regexps of issue texts to exclude, empty list by default. 171 # # But independently from this option we use default exclude patterns, 172 # # it can be disabled by `exclude-use-default: false`. To list all 173 # # excluded by default patterns execute `golangci-lint run --help` 174 # exclude: 175 # - abcdef 176 # 177 # Excluding configuration per-path, per-linter, per-text and per-source 178 exclude-rules: 179 # Exclude some linters from running on tests files. 180 - path: _test\.go 181 linters: 182 - deadcode 183 - unused 184 - goconst 185 - gocritic 186 - gosec 187 - unparam 188 189 - path: _test\.go 190 text: "SA1029" 191 linters: 192 - staticcheck 193 194 - path: _test\.go 195 text: "error-strings|context-keys-type|context-as-argument" 196 linters: 197 - revive 198 199 - linters: 200 - gocritic 201 text: "ifElseChain|appendAssign" 202 203 - linters: 204 - revive 205 text: "unexported-return|error-naming|((type|func) name will be used as)" 206 207 - linters: 208 - stylecheck 209 text: "ST1012" 210 211 - linters: 212 - forcetypeassert 213 text: "type assertion must be checked" 214 215 - linters: 216 - ifshort 217 text: "variable 'errs' is only used in the if-statement" 218 219 # # Exclude known linters from partially hard-vendored code, 220 # # which is impossible to exclude via "nolint" comments. 221 # - path: internal/hmac/ 222 # text: "weak cryptographic primitive" 223 # linters: 224 # - gosec 225 # 226 # # Exclude some staticcheck messages 227 # - linters: 228 # - staticcheck 229 # text: "SA9003:" 230 # 231 # # Exclude lll issues for long lines with go:generate 232 # - linters: 233 # - lll 234 # source: "^//go:generate " 235 # 236 # # Independently from option `exclude` we use default exclude patterns, 237 # # it can be disabled by this option. To list all 238 # # excluded by default patterns execute `golangci-lint run --help`. 239 # # Default value for this option is true. 240 # exclude-use-default: false 241 # 242 # # The default value is false. If set to true exclude and exclude-rules 243 # # regular expressions become case sensitive. 244 # exclude-case-sensitive: false 245 # 246 # The list of ids of default excludes to include or disable. By default it's empty. 247 include: 248 - EXC0012 # disable excluding of issues about comments from revive 249 - EXC0014 250 251 # Maximum issues count per one linter. Set to 0 to disable. Default is 50. 252 max-issues-per-linter: 0 253 254 # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. 255 max-same-issues: 0