checkstyle-idea icon indicating copy to clipboard operation
checkstyle-idea copied to clipboard

SuppressionFilter with ${baseDir} and notifications

Open Geniy00 opened this issue 8 years ago • 3 comments

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.

  1. 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" image I want to turn it off in some way. You can see that this file is optional for checkstyle config
  2. 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.

Geniy00 avatar May 31 '16 14:05 Geniy00

As a simple solution I can turn off checkstyle notification in IDEA Event Log\Settings, then find Checkstyle and chose "No popup"

Geniy00 avatar Jun 01 '16 06:06 Geniy00

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).

jshiell avatar Jun 01 '16 16:06 jshiell

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 😄

jshiell avatar Jun 05 '16 12:06 jshiell