.golangci.yaml 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. version: "2"
  2. linters:
  3. default: none
  4. enable:
  5. - sloglint
  6. - testifylint
  7. settings:
  8. sloglint:
  9. # Enforce key-value pair form for Info/Debug/Warn/Error/Log/With and
  10. # the package-level slog equivalents. Use l.Log(ctx, level, ...) for
  11. # custom levels instead of LogAttrs when you can.
  12. #
  13. # LogAttrs is also flagged by this rule because it takes ...slog.Attr;
  14. # the few legitimate sites (where attrs is built up as a []slog.Attr)
  15. # carry a //nolint:sloglint with rationale.
  16. kv-only: true
  17. # no-mixed-args is on by default: forbids mixing kv and attrs in one call.
  18. # discard-handler is on by default (since Go 1.24): suggests
  19. # slog.DiscardHandler over slog.NewTextHandler(io.Discard, nil).
  20. exclusions:
  21. generated: lax
  22. presets:
  23. - comments
  24. - common-false-positives
  25. - legacy
  26. - std-error-handling
  27. paths:
  28. - third_party$
  29. - builtin$
  30. - examples$
  31. formatters:
  32. exclusions:
  33. generated: lax
  34. paths:
  35. - third_party$
  36. - builtin$
  37. - examples$