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

后端 未结 2 1990
滥情空心
滥情空心 2020-12-05 06:17

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?

2条回答
  •  执笔经年
    2020-12-05 07:12

    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!

提交回复
热议问题