如何从checkstyle配置生成Eclipse格式化程序配置? [英] How to generate an Eclipse formatter configuration from a checkstyle configuration?

查看:517
本文介绍了如何从checkstyle配置生成Eclipse格式化程序配置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个checkstyle配置XML文件,并希望从中自动生成一个Eclipse格式化程序配置。有没有可以做到这一点的工具?

解决方案

在Eclipse(3.6)中:




  • 安装 Checkstyle插件

  • 使用Windows导入样式表 - >首选项,常规 - > Checkstyle - >新建。由于您有外部文件,请选择外部文件作为类型。



右键单击包视图中的项目,选择Checkstyle - > Create Formatter-Profile。



然后为您的工作区启用格式化程序:Windows - >首选项 - > Java - >代码样式 - >格式化。选择格式化程序:eclipse-cs [project name]。



单击OK!


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!

这篇关于如何从checkstyle配置生成Eclipse格式化程序配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆