Eclipse CheckStyle [英] Eclipse CheckStyle

查看:95
本文介绍了Eclipse CheckStyle的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我在Eclipse中添加了一个新的checkstyle(XML)文件。

Recently I added a new checkstyle (XML) file in Eclipse.

运行 mvn checkstyle:checkstyle ,我在A.java中看到了很多checkstyle错误。

After I ran mvn checkstyle:checkstyle, I saw a bunch of checkstyle errors in A.java.

然后,在Eclipse中,我右键单击A.java,然后选择应用Checkstyle修复程序。但是,没有进行任何更改。

Then, in Eclipse, I right-clicked A.java, and picked "Apply Checkstyle Fixes." However, no changes were made.

请为我提供有关如何应用我的样式更改的建议。

Please advise me on how to apply my checkstyle changes.

注意:我没有配置Eclipse来构建。我只使用它来更改代码,然后在命令行上使用maven进行构建。

Note: I do not have Eclipse configured to build. I only use it for changing code, and then I build using maven on the command-line.

谢谢

推荐答案

我不知道您使用的是什么Eclipse插件,但是我使用eclipse-cs。

I don't know what Eclipse plugin you use, but I use eclipse-cs.

在eclipse-cs中,当您编写CheckStyle Checker(用于检测与CheckStyle相关的问题的类)时,您可以编写另一个类,即所谓的quickfix。如果Checker的编写者未提供快速修复,则您将无法使用该修复程序。

In eclipse-cs, when you write a CheckStyle Checker (a class for detecting CheckStyle-related issues), you can write another class as so-called quickfix. If the writer of a Checker does not provide a quickfix, none will be available to you.

对于maven问题,您的maven输出和Eclipse警告有所不同:Eclipse的配置可能与maven读取的配置不同。请确保两个都使用相同的配置文件。

As for the maven issue, where your maven output and Eclipse warnings differ: The configuration of Eclipse may differ from the configuration read by maven. Please make sure both use the same configuration file.

这篇关于Eclipse CheckStyle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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