.golangci.yml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. run:
  2. tests: false
  3. modules-download-mode: readonly
  4. issues:
  5. # The linter has a default list of ignorable errors. Turning this on will enable that list.
  6. exclude-use-default: false
  7. # Maximum issues count per one linter. Set to 0 to disable. Default is 50.
  8. max-issues-per-linter: 0
  9. # Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
  10. max-same-issues: 0
  11. exclude:
  12. - Subprocess launch(ed with variable|ing should be audited)
  13. - Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked
  14. - G307 # Allow closing files as a defer without checking error.
  15. - composite literal uses unkeyed fields
  16. linters:
  17. enable:
  18. - bodyclose
  19. - dupl
  20. - errcheck
  21. - exportloopref
  22. - goconst
  23. - godot
  24. - godox
  25. - goimports
  26. - goprintffuncname
  27. - gosec
  28. - govet
  29. - misspell
  30. - prealloc
  31. - revive
  32. - rowserrcheck
  33. - sqlclosecheck
  34. - staticcheck
  35. - unconvert
  36. - unparam
  37. - whitespace
  38. - nakedret
  39. - cyclop
  40. - gosimple
  41. - varcheck
  42. - unused
  43. - deadcode
  44. - exportloopref
  45. - gocritic
  46. - forbidigo
  47. - unparam
  48. - wastedassign
  49. linters-settings:
  50. govet:
  51. disable:
  52. - composite
  53. cyclop:
  54. # the maximal code complexity to report. default is 10. eventually work our way to that.
  55. max-complexity: 20
  56. # the max average package complexity. If it's higher than 0.0 (float) the check is enabled (default 0.0)
  57. package-average: 0.0
  58. # should ignore tests
  59. skip-tests: true
  60. gosimple:
  61. # Select the Go version to target. The default is '1.13'.
  62. go: "1.17"
  63. # https://staticcheck.io/docs/options#checks
  64. checks: ["all"]
  65. gocritic:
  66. disabled-checks:
  67. - ifElseChain
  68. - exitAfterDefer
  69. forbidigo:
  70. # Forbid the following identifiers (identifiers are written using regexp):
  71. forbid:
  72. # Logging via Print bypasses our logging framework.
  73. - ^(fmt\.Print(|f|ln)|print|println)
  74. - ^panic.*$