Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core Framework
Submitted By: Stephen (scooper)
>Assigned to: Oliver Burn (oburn)
Summary: Dupe of Allow remote references to additional file configura
I am unable to submit my patch to the original feature request, so I'm creating a new feature request and attaching my patch.
When the Checkstyle configuration is defined as a Remote Configuration File over HTTP, for example with the Eclipse Checkstyle plugin, it cannot use a
SuppressionFilter file remotely. (The suppressions.xml file).
This appears to be due to the way that Checkstyle looks up the external SuppressionFilter file with a Java File object.
Allowing the Checkstyle configuration to be published on HTTP would be a great benefit to teams using a standard Checkstyle configuration. However, remote publishing would require that all additional files have a URL location, somewhat like an HTML page.
I've attached a patch with unit tests which implements this functionality. I want it both for the eclipse plugin for checkstyle and also for the maven plugin. We require javadoc on all production methods, but we want to exclude unit tests from that requirement. Since I want there to be one corporate checkstyle file, I have it reference a url for the suppression filter.
I have tested this patch and it does work without breaking the other unit tests or backward compatibility.
The check is that if the file name starts with "http" and it cannot find the file, then it tries to open a URL. The ideal implementation of this would be to open a URL initially, but that would require existing code to change to put the file:// protocol handler in the filename. Since I didn't want to break backward compatibility I chose this route instead.
If you're willing to break backward compatibility then I like how e.g. spring framework references files in the the classpath with the classpath: prefix. You might want to consider that.
Anyway, attached is my patch for your consideration.