.golangci.yml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # See https://github.com/golangci/golangci-lint#config-file
  2. run:
  3. issues-exit-code: 1 #Default
  4. tests: true #Default
  5. linters:
  6. # Disable everything by default so upgrades to not include new "default
  7. # enabled" linters.
  8. disable-all: true
  9. # Specifically enable linters we want to use.
  10. enable:
  11. - deadcode
  12. - errcheck
  13. - gofmt
  14. - goimports
  15. - gosimple
  16. - govet
  17. - godot
  18. - ineffassign
  19. - misspell
  20. - revive
  21. - staticcheck
  22. - structcheck
  23. - typecheck
  24. - unused
  25. - varcheck
  26. issues:
  27. exclude-rules:
  28. # helpers in tests often (rightfully) pass a *testing.T as their first argument
  29. - path: _test\.go
  30. text: "context.Context should be the first parameter of a function"
  31. linters:
  32. - revive
  33. # Yes, they are, but it's okay in a test
  34. - path: _test\.go
  35. text: "exported func.*returns unexported type.*which can be annoying to use"
  36. linters:
  37. - revive
  38. linters-settings:
  39. misspell:
  40. locale: US
  41. ignore-words:
  42. - cancelled
  43. goimports:
  44. local-prefixes: go.opentelemetry.io
  45. godot:
  46. exclude:
  47. # Exclude sentence fragments for lists.
  48. - '^[ ]*[-•]'
  49. # Exclude sentences prefixing a list.
  50. - ':$'