2

I want to write a custom check for checkstyle.

my rule 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.

Sameer Surjikar
  • 511
  • 6
  • 12

1 Answers1

6

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

Blundell
  • 75,855
  • 30
  • 208
  • 233