Author is Ruslan Dyachenko.
After finishing work under your new check you need format your code with Checkstyle format to avoid error messages while building Checkstyle project with your check.
1. Use this formatter which is approximate to origin Checkstyle format. Run Eclipse: Windows — Properties — Java — Code Style — Formatter and import it. Apply formatter on your code.
2.1. Right click on project where you have written your check — Preferences — Checkstyle — ‘Local Check Configurations’ tab — New.
2.2. In opened dialog choose Type – External Configuration File. Write a Name of a new configuration. Browse Location: go to the Checkstyle project folder and choose checkstyle_checks.xml file. Download file and put in profile filesystem path. Press Additional properties… button:
2.3. Press Find unresolved properties button:
2.4. In opened dialog press Yes:
2.5. Now you need to add values for properties.
2.6. Press Ok and return to the Checkstyle preference page. Choose Main tab, from combo list choose your new configuration. Press Ok:
2.7. Right click on your project — Checkstyle — Activate Checkstyle. Fix all checkstyle warnings.