.golangci.yml 2.3 KB

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