简体   繁体   中英

How to generate an Eclipse formatter configuration from a checkstyle configuration?

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):

  • Install Checkstyle plug-in
  • Import stylesheet using Windows --> Preferences, General --> Checkstyle --> New. Since you have an external file, choose "external file" as the type.

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!

Here they say, that you can import a checkstyle configuration directly into the eclipse formatter. Didn't verify, but at least, it's a hint.

If the link doesn't work in your browser, please copy'n'paste this url: http://dbestudio.wiki.sourceforge.net/Code+Formatting+with+Checkstyle

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM