CheckStyle 安装与使用

下载地址:[url]http://eclipse-cs.sourceforge.net/[/url]
下载解压后将plugins目录下的[color=blue]com.atlassw.tools.eclipse.checkstyle_<version>[/color] 拷贝至eclipse plug-in目录,重启即可。
在eclipse下装好后,在windows下可配置全局的codeStyle检查规范,打开 windows -> preferences 可以看到左边菜单多了项Codestyle菜单
如附件所示:
[img]http://ilinux.iteye.com/topics/download/5b5a0a17-484f-38c6-b652-7971e05d14ed[/img]

红色圈住的是sun官方的默认的检查规范。
当然sun的检查规范比较细,也比较全,我们可以根据自己情况来配置自己的Codestyle.xml文件。
上面的myCheck是我自己定义的codeStyle规范。
也可针对某个项目选择check 规范。 选择项目 properties 选项 即可看到,和上图配置差不多。
关于check style文件模板的写法,具体的使用可以去google一把。

[quote]
[color=blue]The eclipse-cs Checkstyle plug-in integrates the well-known source code analyzer Checkstyle into today's leading IDE - Eclipse.
Checkstyle is a development tool written by Oliver Burn to help you ensure that your Java code adheres to a set of coding standards. Checkstyle does this by inspecting your Java source code and pointing out items that deviate from a defined set of coding rules. The full Checkstyle distribution is included with the Checkstyle plug-in. In addition to using the Eclipse Checkstyle plug-in you can also use Checkstyle from the command line or as part of an Ant build. For more information about using Checkstyle outside of Eclipse see the Checkstyle documentation.

With the Checkstyle Eclipse plug-in your code is constantly inspected for problems. Within the Eclipse workbench you are notified of problems via the Eclipse Problems View and source code annotations just as you would see with compiler errors or warnings.[/color][/quote]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值