jshiell / checkstyle-idea

CheckStyle plug-in for IntelliJ IDEA
https://plugins.jetbrains.com/plugin/1065-checkstyle-idea
Other
884 stars 160 forks source link

SuppressionFilter with ${baseDir} and notifications #231

Open Geniy00 opened 8 years ago

Geniy00 commented 8 years ago

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 commented 8 years ago

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

jshiell commented 8 years ago

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 commented 8 years ago

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 😄