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.

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

2 Comments

It's outdated. Check is depracated now.
You can use AbstractCheck instead of Check

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.