I'm using google_checks.xml
as a CheckStyle config in my Gradle project.
I need to be able to suppress the MemberName
warning in one of my classes, and I can do so using @SuppressWarnings("checkstyle:MemberName")
if and only if I add SuppressWarningsHolder
and SuppressWarningsFilter
to google_checks.xml
per this post.
The problem is that I update google_checks.xml
regularly, and I don't want to remember to need to re-add these, so I'd like to handle these suppressions in a separate checkstyle-suppressions.xml
file. This should be doable per this section of google_checks.xml
:
<module name="SuppressionFilter">
<property default="checkstyle-suppressions.xml" name="file"
value="${org.checkstyle.google.suppressionfilter.config}"/>
<property name="optional" value="true"/>
</module>
However, I can't figure out how to get it to look for this file in my project's root directory instead of in the default .gradle\daemon\6.5.1\checkstyle-suppressions.xml
path. How can I point it to another location?
If I set value="${config_loc}/checkstyle-suppressions.xml"
, it does what I want, but we're back to the problem of me not wanting to have to modify google_style.xml
.
It seems like I need to set the org.checkstyle.google.suppressionfilter.config
system property somehow, but I'm not sure where to do this in my Gradle config files, or what exactly to set it to.