I have configured my Eclipse to use a remote checkstyle configuration that is located on a server, which I reach via HTTP. This works fine, but the configuration contains:
<module name="SuppressionFilter">
<property name="file" value="${basedir}/checkstyle-filter.xml"/>
</module>
So I try to set an additional property "basedir" which points to the same directory where the configuration is. When I try to run checkstyle on a project I get an error: cannot initialize module SuppressionsFilter - Cannot set property 'file' in module SuppressionFilter to 'http://"my Url "/checkstyle-filter.xml'
Any suggestions on how to configure Eclipse to use the checkstyle configuration from the server even though it has that it contains the SuppressionFilter? I do not want to put a checkstyle-filter in each project...
This is currently not possible as reported in Remote Configuration Files cannot use a SuppressionFilter - ID: 2018081. Actually, the problem is in Checkstyle which uses a java.io.File
object for the external SuppressionFilter file (and thus setting a value starting with http:// won't work). There is a feature request on Checkstyle to change this (see Allow remote references to additional file configuration - ID: 2018608). But don't expect these changes to occur very soon (unless if you start working hard on it :)
That being said, while I perfectly understand the need for a corporate wide checkstyle configuration file, I'm more surprised by the need for a shared SuppressionFilter file. After all, its content is project specific, isn't it? So, I think that you should actually use another property, for example ${workspace}
(or your own property, my understanding of Expanding property placeholders is that using a .properties
file is supposed to work with a Remote Configuration too) and ask each project to provide its own file with its SuppressionFilter that would be referenced from the workspace. Based on convention, that should work.
Actually, you can use a suppression filter. I have it setup this way with a remote config using the 5.6 eclipse checkstyle plugin. Just put the suppression file in the same remote directory as the checkstyle.xml file and then use the following:
<property name="file" value="${config_loc}/suppression.xml" />
It will then work with eclipse. Basically just replace ${base_dir} with ${config_loc}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With