.golangci.yml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. run:
  2. timeout: 8m
  3. tests: true
  4. build-tags:
  5. - admin
  6. - functional
  7. - integration
  8. skip-dirs:
  9. # paths are relative to module root
  10. - cri-containerd/test-images
  11. linters:
  12. enable:
  13. # defaults:
  14. # - errcheck
  15. # - gosimple
  16. # - govet
  17. # - ineffassign
  18. # - staticcheck
  19. # - typecheck
  20. # - unused
  21. - gofmt # whether code was gofmt-ed
  22. - nolintlint # ill-formed or insufficient nolint directives
  23. - stylecheck # golint replacement
  24. - thelper # test helpers without t.Helper()
  25. linters-settings:
  26. stylecheck:
  27. # https://staticcheck.io/docs/checks
  28. checks: ["all"]
  29. issues:
  30. exclude-rules:
  31. # path is relative to module root, which is ./test/
  32. - path: cri-containerd
  33. linters:
  34. - stylecheck
  35. text: "^ST1003: should not use underscores in package names$"
  36. source: "^package cri_containerd$"
  37. # This repo has a LOT of generated schema files, operating system bindings, and other
  38. # things that ST1003 from stylecheck won't like (screaming case Windows api constants for example).
  39. # There's also some structs that we *could* change the initialisms to be Go friendly
  40. # (Id -> ID) but they're exported and it would be a breaking change.
  41. # This makes it so that most new code, code that isn't supposed to be a pretty faithful
  42. # mapping to an OS call/constants, or non-generated code still checks if we're following idioms,
  43. # while ignoring the things that are just noise or would be more of a hassle than it'd be worth to change.
  44. - path: layer.go
  45. linters:
  46. - stylecheck
  47. Text: "ST1003:"
  48. - path: hcsshim.go
  49. linters:
  50. - stylecheck
  51. Text: "ST1003:"
  52. - path: cmd\\ncproxy\\nodenetsvc\\
  53. linters:
  54. - stylecheck
  55. Text: "ST1003:"
  56. - path: cmd\\ncproxy_mock\\
  57. linters:
  58. - stylecheck
  59. Text: "ST1003:"
  60. - path: internal\\hcs\\schema2\\
  61. linters:
  62. - stylecheck
  63. - gofmt
  64. - path: internal\\wclayer\\
  65. linters:
  66. - stylecheck
  67. Text: "ST1003:"
  68. - path: hcn\\
  69. linters:
  70. - stylecheck
  71. Text: "ST1003:"
  72. - path: internal\\hcs\\schema1\\
  73. linters:
  74. - stylecheck
  75. Text: "ST1003:"
  76. - path: internal\\hns\\
  77. linters:
  78. - stylecheck
  79. Text: "ST1003:"
  80. - path: ext4\\internal\\compactext4\\
  81. linters:
  82. - stylecheck
  83. Text: "ST1003:"
  84. - path: ext4\\internal\\format\\
  85. linters:
  86. - stylecheck
  87. Text: "ST1003:"
  88. - path: internal\\guestrequest\\
  89. linters:
  90. - stylecheck
  91. Text: "ST1003:"
  92. - path: internal\\guest\\prot\\
  93. linters:
  94. - stylecheck
  95. Text: "ST1003:"
  96. - path: internal\\windevice\\
  97. linters:
  98. - stylecheck
  99. Text: "ST1003:"
  100. - path: internal\\winapi\\
  101. linters:
  102. - stylecheck
  103. Text: "ST1003:"
  104. - path: internal\\vmcompute\\
  105. linters:
  106. - stylecheck
  107. Text: "ST1003:"
  108. - path: internal\\regstate\\
  109. linters:
  110. - stylecheck
  111. Text: "ST1003:"
  112. - path: internal\\hcserror\\
  113. linters:
  114. - stylecheck
  115. Text: "ST1003:"
  116. # v0 APIs are deprecated, but still retained for backwards compatability
  117. - path: cmd\\ncproxy\\
  118. linters:
  119. - staticcheck
  120. text: "^SA1019: .*(ncproxygrpc|nodenetsvc)[/]?v0"
  121. - path: internal\\tools\\networkagent
  122. linters:
  123. - staticcheck
  124. text: "^SA1019: .*nodenetsvc[/]?v0"