.golangci.yml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. service:
  2. golangci-lint-version: 1.61.x # use the fixed version to not introduce new linters unexpectedly
  3. run:
  4. concurrency: 4
  5. # timeout for analysis, e.g. 30s, 5m, default is 1m
  6. timeout: 20m
  7. build-tags:
  8. - integ
  9. - integfuzz
  10. linters:
  11. disable-all: true
  12. enable:
  13. - unused
  14. - errcheck
  15. - copyloopvar
  16. - gocritic
  17. - gofumpt
  18. - goimports
  19. - revive
  20. - gosimple
  21. - govet
  22. - ineffassign
  23. - lll
  24. - misspell
  25. - staticcheck
  26. - stylecheck
  27. - typecheck
  28. - unconvert
  29. - unparam
  30. - gci
  31. - gosec
  32. - asciicheck
  33. - prealloc
  34. - predeclared
  35. - makezero
  36. fast: false
  37. linters-settings:
  38. errcheck:
  39. # report about not checking of errors in type assetions: `a := b.(MyStruct)`;
  40. # default is false: such cases aren't reported by default.
  41. check-type-assertions: false
  42. # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
  43. # default is false: such cases aren't reported by default.
  44. check-blank: false
  45. govet:
  46. # report about shadowed variables
  47. check-shadowing: false
  48. maligned:
  49. # print struct with more effective memory layout or not, false by default
  50. suggest-new: true
  51. misspell:
  52. # Correct spellings using locale preferences for US or UK.
  53. # Default is to use a neutral variety of English.
  54. # Setting locale to US will correct the British spelling of 'colour' to 'color'.
  55. locale: US
  56. ignore-words:
  57. - cancelled
  58. - marshalled
  59. lll:
  60. # max line length, lines longer will be reported. Default is 120.
  61. # '\t' is counted as 1 character by default, and can be changed with the tab-width option
  62. line-length: 160
  63. # tab width in spaces. Default to 1.
  64. tab-width: 1
  65. gocritic:
  66. disabled-checks:
  67. - exitAfterDefer
  68. unused:
  69. check-exported: false
  70. unparam:
  71. # Inspect exported functions, default is false. Set to true if no external program/library imports your code.
  72. # XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
  73. # if it's called for subdir of a project it can't find external interfaces. All text editor integrations
  74. # with golangci-lint call it on a directory with the changed file.
  75. check-exported: false
  76. gci:
  77. sections:
  78. - standard
  79. - default
  80. - prefix(github.com/fatedier/frp/)
  81. gosec:
  82. severity: "low"
  83. confidence: "low"
  84. excludes:
  85. - G401
  86. - G402
  87. - G404
  88. - G501
  89. - G115 # integer overflow conversion
  90. issues:
  91. # List of regexps of issue texts to exclude, empty list by default.
  92. # But independently from this option we use default exclude patterns,
  93. # it can be disabled by `exclude-use-default: false`. To list all
  94. # excluded by default patterns execute `golangci-lint run --help`
  95. # exclude:
  96. # - composite literal uses unkeyed fields
  97. exclude-rules:
  98. # Exclude some linters from running on test files.
  99. - path: _test\.go$|^tests/|^samples/
  100. linters:
  101. - errcheck
  102. - maligned
  103. - linters:
  104. - revive
  105. - stylecheck
  106. text: "use underscores in Go names"
  107. - linters:
  108. - revive
  109. text: "unused-parameter"
  110. - linters:
  111. - unparam
  112. text: "is always false"
  113. exclude-dirs:
  114. - genfiles$
  115. - vendor$
  116. - bin$
  117. exclude-files:
  118. - ".*\\.pb\\.go"
  119. - ".*\\.gen\\.go"
  120. # Independently from option `exclude` we use default exclude patterns,
  121. # it can be disabled by this option. To list all
  122. # excluded by default patterns execute `golangci-lint run --help`.
  123. # Default value for this option is true.
  124. exclude-use-default: true
  125. # Maximum issues count per one linter. Set to 0 to disable. Default is 50.
  126. max-per-linter: 0
  127. # Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
  128. max-same-issues: 0