github.com/diadata-org/diadata@v1.4.593/.golangci.yml (about) 1 # This file contains all available configuration options 2 # with their default values. 3 4 # options for analysis running 5 run: 6 # default concurrency is a available CPU number 7 concurrency: 4 8 9 # timeout for analysis, e.g. 30s, 5m, default is 1m 10 timeout: 5m 11 12 # exit code when at least one issue was found, default is 1 13 issues-exit-code: 1 14 15 # include test files or not, default is true 16 tests: false 17 18 # list of build tags, all linters use it. Default is empty list. 19 build-tags: [] 20 21 # which dirs to skip: issues from them won't be reported; 22 # can use regexp here: generated.*, regexp is applied on full path; 23 # default value is empty list, but default dirs are skipped independently 24 # from this option's value (see skip-dirs-use-default). 25 # "/" will be replaced by current OS file path separator to properly work 26 # on Windows. 27 skip-dirs: 28 - /internal/pkg/blockchain-scrapers/blockchains/ethereum/scrapers/* 29 30 # default is true. Enables skipping of directories: 31 # vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ 32 skip-dirs-use-default: true 33 34 # which files to skip: they will be analyzed, but issues from them 35 # won't be reported. Default value is empty list, but there is 36 # no need to include all autogenerated files, we confidently recognize 37 # autogenerated files. If it's not please let us know. 38 # "/" will be replaced by current OS file path separator to properly work 39 # on Windows. 40 skip-files: 41 - pkg/dia/scraper/exchange-scrapers/curvefi/token/token.go 42 - pkg/dia/scraper/exchange-scrapers/balancer/balancertoken/balancertoken.go 43 - pkg/dia/scraper/exchange-scrapers/dforce/token/token.go 44 - pkg/dia/scraper/exchange-scrapers/platypusfinance/token/token.go 45 - pkg/dia/scraper/exchange-scrapers/balancer/token/token.go 46 - pkg/dia/scraper/exchange-scrapers/kyber/token/token.go 47 - pkg/dia/scraper/exchange-scrapers/zerox/token/token.go 48 - config/nftContracts/sorare/sorare.go 49 50 # by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules": 51 # If invoked with -mod=readonly, the go command is disallowed from the implicit 52 # automatic updating of go.mod described above. Instead, it fails when any changes 53 # to go.mod are needed. This setting is most useful to check that go.mod does 54 # not need updates, such as in a continuous integration and testing system. 55 # If invoked with -mod=vendor, the go command assumes that the vendor 56 # directory holds the correct copies of dependencies and ignores 57 # the dependency descriptions in go.mod. 58 #modules-download-mode: readonly|vendor|mod 59 modules-download-mode: readonly 60 61 # Allow multiple parallel golangci-lint instances running. 62 # If false (default) - golangci-lint acquires file lock on start. 63 allow-parallel-runners: false 64 65 66 # output configuration options 67 output: 68 # colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number" 69 format: colored-line-number 70 71 # print lines of code with issue, default is true 72 print-issued-lines: true 73 74 # print linter name in the end of issue text, default is true 75 print-linter-name: true 76 77 # make issues output unique by line, default is true 78 uniq-by-line: true 79 80 # add a prefix to the output file references; default is no prefix 81 path-prefix: "" 82 83 # sorts results by: filepath, line and column 84 sort-results: false 85 86 87 # all available settings of specific linters 88 linters-settings: 89 dogsled: 90 # checks assignments with too many blank identifiers; default is 2 91 max-blank-identifiers: 2 92 dupl: 93 # tokens count to trigger issue, 150 by default 94 threshold: 100 95 errcheck: 96 # report about not checking of errors in type assertions: `a := b.(MyStruct)`; 97 # default is false: such cases aren't reported by default. 98 check-type-assertions: false 99 100 # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`; 101 # default is false: such cases aren't reported by default. 102 check-blank: false 103 104 # path to a file containing a list of functions to exclude from checking 105 # see https://github.com/kisielk/errcheck#excluding-functions for details 106 #exclude: /path/to/file.txt 107 exhaustive: 108 # check switch statements in generated files also 109 check-generated: false 110 # indicates that switch statements are to be considered exhaustive if a 111 # 'default' case is present, even if all enum members aren't listed in the 112 # switch 113 default-signifies-exhaustive: false 114 exhaustivestruct: 115 struct-patterns: 116 - '*.Test' 117 - '*.Test2' 118 - '*.Embedded' 119 - '*.External' 120 funlen: 121 lines: 60 122 statements: 40 123 gci: 124 # put imports beginning with prefix after 3rd-party packages; 125 # only support one prefix 126 # if not set, use goimports.local-prefixes 127 #local-prefixes: github.com/org/project 128 gocognit: 129 # minimal code complexity to report, 30 by default (but we recommend 10-20) 130 min-complexity: 10 131 nestif: 132 # minimal complexity of if statements to report, 5 by default 133 min-complexity: 4 134 goconst: 135 # minimal length of string constant, 3 by default 136 min-len: 3 137 # minimal occurrences count to trigger, 3 by default 138 min-occurrences: 3 139 gocritic: 140 # Which checks should be enabled; can't be combined with 'disabled-checks'; 141 # See https://go-critic.github.io/overview#checks-overview 142 # To check which checks are enabled run `GL_DEBUG=gocritic golangci-lint run` 143 # By default list of stable checks is used. 144 enabled-checks: 145 - rangeValCopy 146 - hugeParam 147 - underef 148 - nestingReduce 149 - rangeExprCopy 150 - captLocal 151 - elseif 152 - truncateCmp 153 154 # Which checks should be disabled; can't be combined with 'enabled-checks'; default is empty 155 #disabled-checks: 156 # - regexpMust 157 158 # Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint run` to see all tags and checks. 159 # Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags". 160 #enabled-tags: 161 # - performance 162 #disabled-tags: 163 # - experimental 164 165 # Settings passed to gocritic. 166 # The settings key is the name of a supported gocritic checker. 167 # The list of supported checkers can be find in https://go-critic.github.io/overview. 168 settings: 169 captLocal: # must be valid enabled check name 170 # whether to restrict checker to params only (default true) 171 paramsOnly: true 172 elseif: 173 # whether to skip balanced if-else pairs (default true) 174 skipBalanced: true 175 hugeParam: 176 # size in bytes that makes the warning trigger (default 80) 177 sizeThreshold: 80 178 nestingReduce: 179 # min number of statements inside a branch to trigger a warning (default 5) 180 bodyWidth: 5 181 rangeExprCopy: 182 # size in bytes that makes the warning trigger (default 512) 183 sizeThreshold: 512 184 # whether to check test functions (default true) 185 skipTestFuncs: true 186 rangeValCopy: 187 # size in bytes that makes the warning trigger (default 128) 188 sizeThreshold: 32 189 # whether to check test functions (default true) 190 skipTestFuncs: true 191 truncateCmp: 192 # whether to skip int/uint/uintptr types (default true) 193 skipArchDependent: true 194 underef: 195 # whether to skip (*x).method() calls where x is a pointer receiver (default true) 196 skipRecvDeref: true 197 unnamedResult: 198 # whether to check exported functions 199 checkExported: true 200 gocyclo: 201 # minimal code complexity to report, 30 by default (but we recommend 10-20) 202 min-complexity: 10 203 204 cyclop: 205 # the maximal code complexity to report 206 max-complexity: 10 207 # the maximal average package complexity. If it's higher than 0.0 (float) the check is enabled (default 0.0) 208 package-average: 0.0 209 # should ignore tests (default false) 210 skip-tests: false 211 godot: 212 # comments to be checked: `declarations`, `toplevel`, or `all` 213 scope: declarations 214 # list of regexps for excluding particular comment lines from check 215 exclude: 216 # example: exclude comments which contain numbers 217 # - '[0-9]+' 218 # check that each sentence starts with a capital letter 219 capital: false 220 godox: 221 # report any comments starting with keywords, this is useful for TODO or FIXME comments that 222 # might be left in the code accidentally and should be resolved before merging 223 keywords: # default keywords are TODO, BUG, and FIXME, these can be overwritten by this setting 224 - NOTE 225 - OPTIMIZE # marks code that should be optimized before merging 226 - HACK # marks hack-arounds that should be removed before merging 227 gofmt: 228 # simplify code: gofmt with `-s` option, true by default 229 simplify: true 230 goheader: 231 values: 232 const: 233 # define here const type values in format k:v, for example: 234 # COMPANY: MY COMPANY 235 regexp: 236 # define here regexp type values, for example 237 # AUTHOR: .*@mycompany\.com 238 template: # |- 239 # put here copyright header template for source code files, for example: 240 # Note: {{ YEAR }} is a builtin value that returns the year relative to the current machine time. 241 # 242 # {{ AUTHOR }} {{ COMPANY }} {{ YEAR }} 243 # SPDX-License-Identifier: Apache-2.0 244 245 # Licensed under the Apache License, Version 2.0 (the "License"); 246 # you may not use this file except in compliance with the License. 247 # You may obtain a copy of the License at: 248 249 # http://www.apache.org/licenses/LICENSE-2.0 250 251 # Unless required by applicable law or agreed to in writing, software 252 # distributed under the License is distributed on an "AS IS" BASIS, 253 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 254 # See the License for the specific language governing permissions and 255 # limitations under the License. 256 template-path: 257 # also as alternative of directive 'template' you may put the path to file with the template source 258 goimports: 259 # put imports beginning with prefix after 3rd-party packages; 260 # it's a comma-separated list of prefixes 261 #local-prefixes: github.com/org/project 262 golint: 263 # minimal confidence for issues, default is 0.8 264 min-confidence: 0.8 265 gomnd: 266 settings: 267 mnd: 268 # the list of enabled checks, see https://github.com/tommy-muehle/go-mnd/#checks for description. 269 checks: 270 - argument 271 - case 272 - condition 273 - operation 274 - return 275 - assign 276 # ignored-numbers: 1000 277 # ignored-files: magic_.*.go 278 # ignored-functions: math.* 279 gomodguard: 280 allowed: 281 modules: # List of allowed modules 282 # - gopkg.in/yaml.v2 283 domains: # List of allowed module domains 284 # - golang.org 285 blocked: 286 modules: # List of blocked modules 287 # - github.com/uudashr/go-module: # Blocked module 288 # recommendations: # Recommended modules that should be used instead (Optional) 289 # - golang.org/x/mod 290 # reason: "`mod` is the official go.mod parser library." # Reason why the recommended module should be used (Optional) 291 versions: # List of blocked module version constraints 292 # - github.com/mitchellh/go-homedir: # Blocked module with version constraint 293 # version: "< 1.1.0" # Version constraint, see https://github.com/Masterminds/semver#basic-comparisons 294 # reason: "testing if blocked version constraint works." # Reason why the version constraint exists. (Optional) 295 local_replace_directives: false # Set to true to raise lint issues for packages that are loaded from a local path via replace directive 296 govet: 297 # report about shadowed variables 298 check-shadowing: true 299 300 # settings per analyzer 301 settings: 302 printf: # analyzer name, run `go tool vet help` to see all analyzers 303 funcs: # run `go tool vet help printf` to see available settings for `printf` analyzer 304 - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof 305 - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf 306 - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf 307 - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf 308 309 # enable or disable analyzers by name 310 # run `go tool vet help` to see all analyzers 311 enable: 312 - atomicalign 313 enable-all: false 314 disable: 315 - shadow 316 disable-all: false 317 depguard: 318 list-type: blacklist 319 include-go-root: false 320 packages: 321 - github.com/sirupsen/logrus 322 packages-with-error-message: 323 # specify an error message to output when a blacklisted package is used 324 - github.com/sirupsen/logrus: "logging is allowed only by logutils.Log" 325 ifshort: 326 # Maximum length of variable declaration measured in number of lines, after which linter won't suggest using short syntax. 327 # Has higher priority than max-decl-chars. 328 max-decl-lines: 1 329 # Maximum length of variable declaration measured in number of characters, after which linter won't suggest using short syntax. 330 max-decl-chars: 30 331 lll: 332 # max line length, lines longer will be reported. Default is 120. 333 # '\t' is counted as 1 character by default, and can be changed with the tab-width option 334 line-length: 120 335 # tab width in spaces. Default to 1. 336 tab-width: 1 337 maligned: 338 # print struct with more effective memory layout or not, false by default 339 suggest-new: true 340 misspell: 341 # Correct spellings using locale preferences for US or UK. 342 # Default is to use a neutral variety of English. 343 # Setting locale to US will correct the British spelling of 'colour' to 'color'. 344 locale: US 345 ignore-words: 346 - someword 347 nakedret: 348 # make an issue if func has more lines of code than this setting and it has naked returns; default is 30 349 max-func-lines: 30 350 prealloc: 351 # XXX: we don't recommend using this linter before doing performance profiling. 352 # For most programs usage of prealloc will be a premature optimization. 353 354 # Report preallocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them. 355 # True by default. 356 simple: true 357 range-loops: true # Report preallocation suggestions on range loops, true by default 358 for-loops: false # Report preallocation suggestions on for loops, false by default 359 predeclared: 360 # comma-separated list of predeclared identifiers to not report on 361 ignore: "" 362 # include method names and field names (i.e., qualified names) in checks 363 q: false 364 nolintlint: 365 # Enable to ensure that nolint directives are all used. Default is true. 366 allow-unused: false 367 # Disable to ensure that nolint directives don't have a leading space. Default is true. 368 allow-leading-space: true 369 # Exclude following linters from requiring an explanation. Default is []. 370 allow-no-explanation: [] 371 # Enable to require an explanation of nonzero length after each nolint directive. Default is false. 372 require-explanation: true 373 # Enable to require nolint directives to mention the specific linter being suppressed. Default is false. 374 require-specific: true 375 rowserrcheck: 376 packages: 377 - github.com/jmoiron/sqlx 378 revive: 379 # see https://github.com/mgechev/revive#available-rules for details. 380 ignore-generated-header: true 381 severity: warning 382 rules: 383 - name: indent-error-flow 384 severity: warning 385 testpackage: 386 # regexp pattern to skip files 387 skip-regexp: (export|internal)_test\.go 388 thelper: 389 # The following configurations enable all checks. It can be omitted because all checks are enabled by default. 390 # You can enable only required checks deleting unnecessary checks. 391 test: 392 first: true 393 name: true 394 begin: true 395 benchmark: 396 first: true 397 name: true 398 begin: true 399 tb: 400 first: true 401 name: true 402 begin: true 403 unparam: 404 # Inspect exported functions, default is false. Set to true if no external program/library imports your code. 405 # XXX: if you enable this setting, unparam will report a lot of false-positives in text editors: 406 # if it's called for subdir of a project it can't find external interfaces. All text editor integrations 407 # with golangci-lint call it on a directory with the changed file. 408 check-exported: false 409 unused: 410 # treat code as a program (not a library) and report unused exported identifiers; default is false. 411 # XXX: if you enable this setting, unused will report a lot of false-positives in text editors: 412 # if it's called for subdir of a project it can't find funcs usages. All text editor integrations 413 # with golangci-lint call it on a directory with the changed file. 414 check-exported: false 415 whitespace: 416 multi-if: false # Enforces newlines (or comments) after every multi-line if statement 417 multi-func: false # Enforces newlines (or comments) after every multi-line function signature 418 wsl: 419 # If true append is only allowed to be cuddled if appending value is 420 # matching variables, fields or types on line above. Default is true. 421 strict-append: true 422 # Allow calls and assignments to be cuddled as long as the lines have any 423 # matching variables, fields or types. Default is true. 424 allow-assign-and-call: true 425 # Allow assignments to be cuddled with anything. Default is false. 426 allow-assign-and-anything: false 427 # Allow multiline assignments to be cuddled. Default is true. 428 allow-multiline-assign: true 429 # Allow declarations (var) to be cuddled. 430 allow-cuddle-declarations: false 431 # Allow trailing comments in ending of blocks 432 allow-trailing-comment: false 433 # Force newlines in end of case at this limit (0 = never). 434 force-case-trailing-whitespace: 0 435 # Force cuddling of err checks with err var assignment 436 force-err-cuddling: false 437 # Allow leading comments to be separated with empty liens 438 allow-separated-leading-comment: false 439 gofumpt: 440 # Choose whether or not to use the extra rules that are disabled 441 # by default 442 extra-rules: false 443 errorlint: 444 # Report non-wrapping error creation using fmt.Errorf 445 errorf: true 446 makezero: 447 # Allow only slices initialized with a length of zero. Default is false. 448 always: false 449 forbidigo: 450 # Forbid the following identifiers 451 forbid: 452 - fmt.Errorf # consider errors.Errorf in github.com/pkg/errors 453 - fmt.Print.* # too much log noise 454 - ginkgo\\.F.* # these are used just for local development 455 # Exclude godoc examples from forbidigo checks. Default is true. 456 exclude_godoc_examples: false 457 importas: 458 # using `servingv1` alias for `knative.dev/serving/pkg/apis/serving/v1` package 459 servingv1: knative.dev/serving/pkg/apis/serving/v1 460 # using `autoscalingv1alpha1` alias for `knative.dev/serving/pkg/apis/autoscaling/v1alpha1` package 461 autoscalingv1alpha1: knative.dev/serving/pkg/apis/autoscaling/v1alpha1 462 463 # The custom section can be used to define linter plugins to be loaded at runtime. See README doc 464 # for more info. 465 #custom: 466 # Each custom linter should have a unique name. 467 #example: 468 # The path to the plugin *.so. Can be absolute or local. Required for each custom linter 469 #path: /path/to/example.so 470 # The description of the linter. Optional, just for documentation purposes. 471 #description: This is an example usage of a plugin linter. 472 # Intended to point to the repo location of the linter. Optional, just for documentation purposes. 473 #original-url: github.com/golangci/example-linter 474 475 linters: 476 enable: 477 - megacheck 478 - govet 479 disable: 480 - maligned 481 - prealloc 482 disable-all: false 483 presets: 484 - bugs 485 - unused 486 fast: false 487 488 489 issues: 490 # List of regexps of issue texts to exclude, empty list by default. 491 # But independently from this option we use default exclude patterns, 492 # it can be disabled by `exclude-use-default: false`. To list all 493 # excluded by default patterns execute `golangci-lint run --help` 494 exclude: 495 - abcdef 496 497 # Excluding configuration per-path, per-linter, per-text and per-source 498 exclude-rules: 499 # Exclude some linters from running on tests files. 500 - path: _test\.go 501 linters: 502 - gocyclo 503 - errcheck 504 - dupl 505 - gosec 506 507 # Exclude known linters from partially hard-vendored code, 508 # which is impossible to exclude via "nolint" comments. 509 - path: internal/hmac/ 510 text: "weak cryptographic primitive" 511 linters: 512 - gosec 513 514 # Exclude some staticcheck messages 515 - linters: 516 - staticcheck 517 text: "SA9003:" 518 519 # Exclude lll issues for long lines with go:generate 520 - linters: 521 - lll 522 source: "^//go:generate " 523 524 # Independently from option `exclude` we use default exclude patterns, 525 # it can be disabled by this option. To list all 526 # excluded by default patterns execute `golangci-lint run --help`. 527 # Default value for this option is true. 528 exclude-use-default: false 529 530 # The default value is false. If set to true exclude and exclude-rules 531 # regular expressions become case sensitive. 532 exclude-case-sensitive: false 533 534 # The list of ids of default excludes to include or disable. By default it's empty. 535 include: 536 - EXC0002 # disable excluding of issues about comments from golint 537 538 # Maximum issues count per one linter. Set to 0 to disable. Default is 50. 539 max-issues-per-linter: 0 540 541 # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. 542 max-same-issues: 0 543 544 # Show only new issues: if there are unstaged changes or untracked files, 545 # only those changes are analyzed, else only changes in HEAD~ are analyzed. 546 # It's a super-useful option for integration of golangci-lint into existing 547 # large codebase. It's not practical to fix all existing issues at the moment 548 # of integration: much better don't allow issues in new code. 549 # Default is false. 550 new: false 551 552 # Show only new issues created after git revision `REV` 553 new-from-rev: REV 554 555 # Show only new issues created in git patch with set file path. 556 #new-from-patch: path/to/patch/file 557 558 # Fix found issues (if it's supported by the linter) 559 fix: true 560 561 severity: 562 # Default value is empty string. 563 # Set the default severity for issues. If severity rules are defined and the issues 564 # do not match or no severity is provided to the rule this will be the default 565 # severity applied. Severities should match the supported severity names of the 566 # selected out format. 567 # - Code climate: https://docs.codeclimate.com/docs/issues#issue-severity 568 # - Checkstyle: https://checkstyle.sourceforge.io/property_types.html#severity 569 # - Github: https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message 570 default-severity: error 571 572 # The default value is false. 573 # If set to true severity-rules regular expressions become case sensitive. 574 case-sensitive: false 575 576 # Default value is empty list. 577 # When a list of severity rules are provided, severity information will be added to lint 578 # issues. Severity rules have the same filtering capability as exclude rules except you 579 # are allowed to specify one matcher per severity rule. 580 # Only affects out formats that support setting severity information. 581 rules: 582 - linters: 583 - dupl 584 severity: info