checkstyle-idea
checkstyle-idea copied to clipboard
SuppressionFilter with ${baseDir} and notifications
I have a problem on my environment: Idea 2016.1.2 Checkstyle-IDEA 4.28.1 checkstyle "6.17"
I have checkstyle config
<module name="SuppressionFilter">
<property name="file" value="${baseDir}/gradle/checkstyle-exclude.xml"/>
<property name="optional" value="true"/>
</module>
I've added baseDir variable to checkstyle plugin configuration.
- The main problem is that it shown IDEA notifications, when I opened any class
" The Checkstyle suppression filter file was not found and will be ignored"
I want to turn it off in some way. You can see that this file is optional for checkstyle config
- Next problem that can be important: I use gradle multi module project. Checkstyle plugin configuration for gradle is configured in one place in the next way
checkstyle {
toolVersion = "6.17"
sourceSets = [sourceSets.main]
ignoreFailures = true
showViolations = true
reportsDir = file("$project.buildDir/checkstyleReports")
configFile = file("$rootDir/gradle/checkstyle.xml")
configProperties = ['baseDir': "$project.projectDir"] //Pay attention
}
baseDir is overridden for each gradle module. I create checkstyle-exclude.xml per module if I need it. The possible problem is that checkstyle IDEA plugin requires only one fixed exclude rule file.
As a simple solution I can turn off checkstyle notification in IDEA Event Log\Settings, then find Checkstyle and chose "No popup"
Thanks for the report!
We currently don't support the optional
flag - I'll have a look at adding that, hopefully this weekend.
On the exclude files, I'll have a look at what's going on - it's entirely possible it's resolving it once and then failing to do so again, as basedir
should indeed be mapped to the base dir of the current module if it's not explicitly defined (as it is for Eclipse-CS).
As of 4.29.0 the optional
property should now be taken into account when files are missing.
Part two will have to wait a bit I fear, as my head is mush with hay fever 😄