开发者

Project-specific Checkstyle configuration in Eclipse

Is there a way to define a configuration XML for Checkstyle in Eclipse that would be project specific, as in "you put a XML file in the project tree and Checkstyle recognizes it"?

As far as I've researched, I've seen how to change the configuration for Eclipse as a whole, and how to include a Supressions Filter, which (as far as I understand) is not what I'm looking for since it works only to supress particular instances of warnings in given files/lines, but I want to supress classes of errors (disabling the "blank space at and of line" - which seriously bothers me because Eclipse's editor/formatter keeps pushing me to do it the 'wron开发者_StackOverflow中文版g way' -, for example).


Yes, it's possible.

It's a project-relative configuration: http://eclipse-cs.sourceforge.net/advanced_configtypes.html

Sample .checkstyle:

<?xml version="1.0" encoding="UTF-8"?>
<fileset-config file-format-version="1.2.0" simple-config="false">
    <local-check-config name="project-checkstyle-config" location="/myProject/checkstyle.xml" type="project" description="Project-specific Configuration">
        <additional-data name="protect-config-file" value="false"/>
    </local-check-config>        
</fileset-config>


You can define any specific validation at Project properties (right click on the project node at project explorer). It includes checkstyle validations.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜