.golangci.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. linters:
  2. enable:
  3. - exportloopref # Checks for pointers to enclosing loop variables
  4. - gofmt
  5. - goimports
  6. - gosec
  7. - ineffassign
  8. - misspell
  9. - nolintlint
  10. - revive
  11. - staticcheck
  12. - tenv # Detects using os.Setenv instead of t.Setenv since Go 1.17
  13. - unconvert
  14. - unused
  15. - vet
  16. - dupword # Checks for duplicate words in the source code
  17. disable:
  18. - errcheck
  19. issues:
  20. include:
  21. - EXC0002
  22. max-issues-per-linter: 0
  23. max-same-issues: 0
  24. # Only using / doesn't work due to https://github.com/golangci/golangci-lint/issues/1398.
  25. exclude-rules:
  26. - path: 'cmd[\\/]containerd[\\/]builtins[\\/]'
  27. text: "blank-imports:"
  28. - path: 'contrib[\\/]fuzz[\\/]'
  29. text: "exported: func name will be used as fuzz.Fuzz"
  30. - path: 'archive[\\/]tarheader[\\/]'
  31. # conversion is necessary on Linux, unnecessary on macOS
  32. text: "unnecessary conversion"
  33. # FIXME temporarily suppress deprecation warnings for the logs package. See https://github.com/containerd/containerd/pull/9086
  34. - text: "SA1019: log\\.(G|L|Fields|Entry|RFC3339NanoFixed|Level|TraceLevel|DebugLevel|InfoLevel|WarnLevel|ErrorLevel|FatalLevel|PanicLevel|SetLevel|GetLevel|OutputFormat|TextFormat|JSONFormat|SetFormat|WithLogger|GetLogger)"
  35. linters:
  36. - staticcheck
  37. - text: "SA1019: logtest\\.WithT"
  38. linters:
  39. - staticcheck
  40. linters-settings:
  41. gosec:
  42. # The following issues surfaced when `gosec` linter
  43. # was enabled. They are temporarily excluded to unblock
  44. # the existing workflow, but still to be addressed by
  45. # future works.
  46. excludes:
  47. - G204
  48. - G305
  49. - G306
  50. - G402
  51. - G404
  52. run:
  53. timeout: 8m
  54. skip-dirs:
  55. - api
  56. - cluster
  57. - design
  58. - docs
  59. - docs/man
  60. - releases
  61. - reports
  62. - test # e2e scripts