Eclipse Checkstyle with configuration and SuppressionFilter on server

I configured my Eclipse to use the remote checkstyle configuration, which is located on the server to which I connect via HTTP. This works great, but the configuration contains:

<module name="SuppressionFilter"> <property name="file" value="${basedir}/checkstyle-filter.xml"/> </module> 

So, I am trying to set an additional property, "basedir", which points to the same directory where the configuration is located. When I try to run checkstyle in a project, I get an error: it is not possible to initialize the SuppressionsFilter module - I cannot set the file property in the SuppressionFilter module 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 contains SuppressionFilter? I do not want to put a checkstyle filter in every project ...

+4
source share
3 answers

This is currently not possible, as indicated in Remote Configuration Files cannot use SuppressionFilter-ID: 2018081 . Actually the problem is in Checkstyle, which uses the java.io.File object for the external SuppressionFilter file (and thus the value starting with http: // will not work). To change this, there is a function request on Checkstyle (see Allow remote links to additional file configuration - ID: 2018608 ). But don't expect these changes to happen very soon (unless you start working on it :)

While I understand very well the need to create a corporate checkstyle configuration file, I am more surprised at the need for a shared SuppressionFilter file. In the end, its content depends on the specific project, right? So, I think that you should use another property, for example ${workspace} (or your own property, my understanding is Extending the property tabs that using the .properties file should also work with remote configuration) and ask each project to provide its own file with The SuppressionFilter parameter that will be referenced from the workspace. Based on convention, this should work.

+10
source

I was unable to add a fix to the original function request, so I created a new function request here: https://sourceforge.net/tracker/?func=detail&atid=397081&aid=3485185&group_id=29721

I implemented this functionality because I needed it to allow corporate users to disable certain checks for unit tests and NLS classes generated by Eclipse.

I tested it with eclipse-cs 5.5 version, fixing the jar file for the plugin and it works very well.

0
source

Actually, you can use a suppression filter. I have setup this way with remote configuration using plugin 5.6 eclipse checkstyle. 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" /> 

Then it will work with eclipse. Basically just replace $ {base_dir} with $ {config_loc}

0
source

Source: https://habr.com/ru/post/1299005/


All Articles