checkstyle.xml 5.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <?xml version="1.0"?>
  2. <!DOCTYPE module PUBLIC
  3. "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
  4. "https://checkstyle.org/dtds/configuration_1_3.dtd">
  5. <module name="com.puppycrawl.tools.checkstyle.Checker">
  6. <module name="io.spring.javaformat.checkstyle.SpringChecks">
  7. <property name="excludes" value="com.puppycrawl.tools.checkstyle.checks.imports.AvoidStaticImportCheck" />
  8. </module>
  9. <module name="com.puppycrawl.tools.checkstyle.TreeWalker">
  10. <module name="com.puppycrawl.tools.checkstyle.checks.imports.AvoidStaticImportCheck">
  11. <property name="excludes" value="
  12. io.restassured.RestAssured.*,
  13. org.assertj.core.api.Assertions.*,
  14. org.assertj.core.api.Assumptions.*,
  15. org.assertj.core.api.HamcrestCondition.*,
  16. org.awaitility.Awaitility.*,
  17. org.hamcrest.CoreMatchers.*,
  18. org.hamcrest.Matchers.*,
  19. org.junit.Assert.*,
  20. org.junit.Assume.*,
  21. org.junit.internal.matchers.ThrowableMessageMatcher.*,
  22. org.junit.jupiter.api.Assertions.*,
  23. org.junit.jupiter.api.Assumptions.*,
  24. org.junit.jupiter.api.Assertions.*,
  25. org.mockito.ArgumentMatchers.*,
  26. org.mockito.BDDMockito.*,
  27. org.mockito.Matchers.*,
  28. org.mockito.Mockito.*,
  29. org.springframework.boot.configurationprocessor.ConfigurationMetadataMatchers.*,
  30. org.springframework.boot.configurationprocessor.TestCompiler.*,
  31. org.springframework.boot.test.autoconfigure.AutoConfigurationImportedCondition.*,
  32. org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo,
  33. org.springframework.restdocs.headers.HeaderDocumentation.*,
  34. org.springframework.restdocs.hypermedia.HypermediaDocumentation.*,
  35. org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.*,
  36. org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.*,
  37. org.springframework.restdocs.operation.preprocess.Preprocessors.*,
  38. org.springframework.restdocs.payload.PayloadDocumentation.*,
  39. org.springframework.restdocs.request.RequestDocumentation.*,
  40. org.springframework.restdocs.restassured3.operation.preprocess.RestAssuredPreprocessors.*,
  41. org.springframework.restdocs.restassured3.RestAssuredRestDocumentation.*,
  42. org.springframework.restdocs.snippet.Attributes.*,
  43. org.springframework.restdocs.webtestclient.WebTestClientRestDocumentation.*,
  44. org.springframework.security.config.Customizer.*,
  45. org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.*,
  46. org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.*,
  47. org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.*,
  48. org.springframework.test.web.client.ExpectedCount.*,
  49. org.springframework.test.web.client.match.MockRestRequestMatchers.*,
  50. org.springframework.test.web.client.response.MockRestResponseCreators.*,
  51. org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*,
  52. org.springframework.test.web.servlet.result.MockMvcResultHandlers.*,
  53. org.springframework.test.web.servlet.result.MockMvcResultMatchers.*,
  54. org.springframework.test.web.servlet.setup.MockMvcBuilders.*,
  55. org.springframework.web.reactive.function.BodyInserters.*,
  56. org.springframework.web.reactive.function.server.RequestPredicates.*,
  57. org.springframework.web.reactive.function.server.RouterFunctions.*,
  58. org.springframework.ws.test.client.RequestMatchers.*,
  59. org.springframework.ws.test.client.ResponseCreators.*" />
  60. </module>
  61. <module name="io.spring.javaformat.checkstyle.check.SpringJUnit5Check" />
  62. <module
  63. name="com.puppycrawl.tools.checkstyle.checks.imports.IllegalImportCheck">
  64. <property name="regexp" value="true" />
  65. <property name="illegalPkgs"
  66. value="^sun.*, ^org\.apache\.commons\.(?!compress|dbcp2|lang|lang3|logging|pool2).*, ^com\.datastax\.oss\.driver\.shaded.*, ^com\.google\.common.*, ^io\.micrometer\.shaded.*, ^org\.flywaydb\.core\.internal.*, ^org\.testcontainers\.shaded.*" />
  67. <property name="illegalClasses"
  68. value="^com\.hazelcast\.util\.Base64, ^org\.junit\.rules\.ExpectedException, ^org\.mockito\.InjectMocks, ^org\.slf4j\.LoggerFactory, ^org.springframework.context.annotation.ScannedGenericBeanDefinition, ^reactor\.core\.support\.Assert" />
  69. </module>
  70. <module name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck">
  71. <property name="maximum" value="0"/>
  72. <property name="format" value="org\.junit\.Assert\.assert" />
  73. <property name="message"
  74. value="Please use AssertJ imports." />
  75. <property name="ignoreComments" value="true" />
  76. </module>
  77. <module
  78. name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck">
  79. <property name="maximum" value="0" />
  80. <property name="format"
  81. value="assertThatExceptionOfType\((NullPointerException|IllegalArgumentException|IOException|IllegalStateException)\.class\)" />
  82. <property name="message"
  83. value="Please use specialized AssertJ assertThat*Exception method." />
  84. <property name="ignoreComments" value="true" />
  85. </module>
  86. <module name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck">
  87. <property name="maximum" value="0"/>
  88. <property name="format" value="org\.mockito\.Mockito\.(when|doThrow|doAnswer)" />
  89. <property name="message"
  90. value="Please use BDDMockito imports." />
  91. <property name="ignoreComments" value="true" />
  92. </module>
  93. <module name="io.spring.javaformat.checkstyle.check.SpringJavadocCheck">
  94. <property name="publicOnlySinceTags" value="true" />
  95. <property name="requireSinceTag" value="false" />
  96. </module>
  97. </module>
  98. </module>