Customize Checkstyle checkers, inspired by https://github.com/blundell/CreateYourOwnCheckStyleCheck
Publish to GPR manually by
./gradlew publish
Follow GitHub Help or GitHub Packages in Action to configure settings, and then add dependency:
<dependency>
<groupId>com.github.alphahinex</groupId>
<artifactId>checkstyle-checkers</artifactId>
<version>2.0.0.RELEASE</version>
</dependency>
'com.github.alphahinex:checkstyle-checkers:2.0.0.RELEASE'
Follow How to
in https://jitpack.io/#AlphaHinex/checkstyle-checkers
Default limit is 30, and you can change the default value as below:
<module name="MethodLimit">
<property name="max" value="50"/>
</module>
Only check the swagger annotation on the controller which registered by annotation, not by xml.
- Rule #1: Check
@Api
existed on the class which has@Controller
or@RestController
annotation - Rule #2: Base on Rule #1 (Has
@Api
), check@ApiOperation
existed on the method which has annotation ending withRequestMapping
orMapping
Enable this check by:
<module name="SwaggerAnnotation"/>