Hi Adam,

thank you very much. That was the solution I am searching for. But I didn't know how to inject the path.

Now it works fine.

regards,
Mathias Kalb

Am 20.01.2011 22:08, schrieb Adam Murdoch:

On 20/01/2011, at 11:36 PM, Mathias Kalb wrote:

Hi,

Checkstyle has a SuppressionFilter. You need to define a XML file with suppression rules.

config/checkstyle/checkstyle.xml

<module name="SuppressionFilter">
<property name="file" value="config/checkstyle/suppressions.xml"/>
</module>

The checkstyle SuppressionFilter interprets the file name relative to the working directory of the process, rather than something fixed, such as relative to the configuration file.

Here's (more or less) how we deal with this problem in the Gradle build:

checkstyleProperties.checkstyleConfigDir = checkstyleConfigFile.parentFile

in the checkstyle config file:

<module name="SuppressionFilter">
<property name="file" value="${checkstyleConfigDir}/suppressions.xml"/>
</module>

That is, we inject the path to the config directory into the config file, so that the paths are always absolute and independent of the process' working directory.

This approach works regardless of whether you have a shared config file or one config file per project.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to