开发者

how to write Custom checks in checkstyle?

开发者 https://www.devze.com 2023-04-05 16:46 出处:网络
I want to write a custom check for checkstyle. my rul开发者_JAVA百科e that i want to work with is

I want to write a custom check for checkstyle.

my rul开发者_JAVA百科e that i want to work with is Class should define a constructor- but Suppress this rule for inner classes

how should i go about writing this check.


You can create a custom CheckStyle check by extending the com.puppycrawl.tools.checkstyle.api.Check class, you then create a jar for this project and point CheckStyle to use it. I've written an example here:

http://blog.blundellapps.co.uk/create-your-own-checkstyle-check/

and source code here:

https://github.com/blundell/CreateYourOwnCheckStyleCheck

0

精彩评论

暂无评论...
验证码 换一张
取 消