1

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 'wrong way' -, for example).

2 Answers 2

2

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>
Sign up to request clarification or add additional context in comments.

Comments

1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.