Skip to content

Latest commit

 

History

History
executable file
·
65 lines (42 loc) · 1.91 KB

README.md

File metadata and controls

executable file
·
65 lines (42 loc) · 1.91 KB

TJRouter

Build Status Coverage Status

Customize Checkstyle checkers, inspired by https://github.com/blundell/CreateYourOwnCheckStyleCheck

Install

Use GitHub Packages Registry

Publish to GPR manually by ./gradlew publish

Follow GitHub Help or GitHub Packages in Action to configure settings, and then add dependency:

Maven

<dependency>
     <groupId>com.github.alphahinex</groupId>
     <artifactId>checkstyle-checkers</artifactId>
     <version>2.0.0.RELEASE</version>
</dependency>

Gradle

'com.github.alphahinex:checkstyle-checkers:2.0.0.RELEASE'

Or Use JitPack

Follow How to in https://jitpack.io/#AlphaHinex/checkstyle-checkers

How to use

Method Limit Checker

Default limit is 30, and you can change the default value as below:

<module name="MethodLimit">
   <property name="max" value="50"/>
</module>

Swagger Annotation Checker

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 with RequestMapping or Mapping

Enable this check by:

<module name="SwaggerAnnotation"/>