Quantcast

How to use global checkstyle.xml that have SuppressionsFilter included

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to use global checkstyle.xml that have SuppressionsFilter included

Gayan Weerakutti
So here in my case I want use remote checkstyle file located in https://github.com/openmrs/openmrs-core/blob/master/checkstyle.xml?#L45 in another project.


In my project's pom I have config location set as follows:<https://github.com/openmrs/openmrs-core/blob/master/checkstyle.xml?#L45>


<configLocation>
 https://github.com/openmrs/openmrs-core/blob/master/checkstyle.xml
</configLocation>

However checkstyle can't resolve checkstyle-suppressions.xml because of the configuration included in the remote file:

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

So what would be the ideal solution to be alble to use that remote checkstyle on other projects?. BTW I can get access to openmrs-core to make any necessary changes.

Thanks,
Gayan


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to use global checkstyle.xml that have SuppressionsFilter included

Martin Hoeller
On 09 Mai 2017, Gayan Weerakutti wrote:

> So here in my case I want use remote checkstyle file located in https://github.com/openmrs/openmrs-core/blob/master/checkstyle.xml?#L45 in another project.
>
>
> In my project's pom I have config location set as follows:<https://github.com/openmrs/openmrs-core/blob/master/checkstyle.xml?#L45>
>
>
> <configLocation>
>  https://github.com/openmrs/openmrs-core/blob/master/checkstyle.xml
> </configLocation>
>
> However checkstyle can't resolve checkstyle-suppressions.xml because of the configuration included in the remote file:
>
> <module name="SuppressionFilter">
> <property name="file" value="checkstyle-suppressions.xml"/>
> </module>
>
> So what would be the ideal solution to be alble to use that remote checkstyle on other projects?
What about specifying the suprresion file also in your project:

<configuration>
  <configLocation>
    https://github.com/openmrs/openmrs-core/blob/master/checkstyle.xml
  </configLocation>
  <suppressionsLocation>
    https://github.com/openmrs/openmrs-core/blob/master/checkstyle-suppressions.xml
  </suppressionsLocation>
</configuration>

I don't know if this works, but you could give it a try.

hth,
- martin

attachment0 (205 bytes) Download Attachment
Loading...