I have a checkstyle configuration XML file and want to automatically generate an Eclipse formatter configuration from this. Is there any tool that can do this?
I have a checkstyle configuration XML file and want to automatically generate an Eclipse formatter configuration from this. Is there any tool that can do this?
In Eclipse (3.6):
Right-click on your project in the Package view and select Checkstyle --> Create Formatter-Profile.
Then enable the formatter for your workspace: Windows --> Preferences --> Java --> Code Style --> Formatter. Select formatter: "eclipse-cs [project name]".
Click OK!
The answer currently marked as accepted does not work as is with Eclipse 2022-06 and Checkstyle Plug-in 10.0.0. These are the steps that worked for me:
Install Checkstyle plug-in
Import Checkstyle configuration: Windows -> Preferences -> Checkstyle -> New. Choose "external file" as the type.
Right-click on your project in the Package view and select Checkstyle -> Create Formatter-Profile. The following files will be created in you project:
my-project-cs-cleanup.xmlmy-project-cs-formatter.xmlmy-project-cs-formatter.xml as a formatter: Windows -> Preferences -> Java -> Code Style -> Formatter -> Import