.golangci.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. run:
  2. tests: true
  3. max-same-issues: 50
  4. output:
  5. print-issued-lines: false
  6. linters:
  7. enable:
  8. - gocyclo
  9. - gocritic
  10. - goconst
  11. - dupl
  12. - unconvert
  13. - goimports
  14. - unused
  15. - govet
  16. - nakedret
  17. - errcheck
  18. - revive
  19. - ineffassign
  20. - goconst
  21. - unparam
  22. - gofmt
  23. linters-settings:
  24. vet:
  25. check-shadowing: true
  26. use-installed-packages: true
  27. dupl:
  28. threshold: 100
  29. goconst:
  30. min-len: 8
  31. min-occurrences: 3
  32. gocyclo:
  33. min-complexity: 20
  34. gocritic:
  35. disabled-checks:
  36. - ifElseChain
  37. gofmt:
  38. rewrite-rules:
  39. - pattern: "interface{}"
  40. replacement: "any"
  41. - pattern: "a[b:len(a)]"
  42. replacement: "a[b:]"
  43. issues:
  44. max-per-linter: 0
  45. max-same: 0
  46. exclude-dirs:
  47. - resources
  48. - old
  49. exclude-files:
  50. - cmd/protopkg/main.go
  51. exclude-use-default: false
  52. exclude:
  53. # Captured by errcheck.
  54. - "^(G104|G204):"
  55. # Very commonly not checked.
  56. - 'Error return value of .(.*\.Help|.*\.MarkFlagRequired|(os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*Print(f|ln|)|os\.(Un)?Setenv). is not checked'
  57. # Weird error only seen on Kochiku...
  58. - "internal error: no range for"
  59. - 'exported method `.*\.(MarshalJSON|UnmarshalJSON|URN|Payload|GoString|Close|Provides|Requires|ExcludeFromHash|MarshalText|UnmarshalText|Description|Check|Poll|Severity)` should have comment or be unexported'
  60. - "composite literal uses unkeyed fields"
  61. - 'declaration of "err" shadows declaration'
  62. - "by other packages, and that stutters"
  63. - "Potential file inclusion via variable"
  64. - "at least one file in a package should have a package comment"
  65. - "bad syntax for struct tag pair"