Skip to content

Instantly share code, notes, and snippets.

@soucekv
Last active September 26, 2022 11:15
Show Gist options
  • Save soucekv/a962f788ceb70e418e2f to your computer and use it in GitHub Desktop.
Save soucekv/a962f788ceb70e418e2f to your computer and use it in GitHub Desktop.
Gradle checkstyle with suppression filter module
//Gist note this is snippet from root build.gradle in project with subprojects
checkstyle {
// use one common config file for all subprojects
configFile = project(':').file('config/checkstyle/checkstyle.xml')
configProperties = [ "suppressionFile" : project(':').file('config/checkstyle/suppressions.xml')]
}
<module name="SuppressionFilter">
<property name="file" value="${suppressionFile}"/>
</module>
@EvanOman
Copy link

EvanOman commented Jan 5, 2018

This was so clutch, thanks so much!

I also added a default value so that I could use the same XML file from IntelliJ's checkstyle plugin:

<module name="SuppressionFilter">
	<property name="file" value="${suppressionFile}" default="suppressions.xml"/>
</module>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment