I have the following in my root build.gradle
file.
subprojects {
apply plugin: 'checkstyle'
checkstyle {
maxWarnings = 0
}
}
But it seems IntelliJ only recognizes the checkstyle
extension block if I put the above in a allprojects
block. The IDE simply greys out the checkstyle
keyword and underlines it with a squiggly line. See the image for reference.
When put under the allprojects
block, it works fine:
Can someone explain to me what is happening here? If this is just an IDE thing, would love to have some insight into why this might be happening.
I suppose it's just an IDE thing and happens because in case you are using the allproject
configuration, then your current project is getting a checkstyle
plugin applied too, like all it's child projects, and IDE can find a checkstyle
configuration closure.
Opposite, if you are using the subproject
, your current project configuration doesn't have a checkstyle
plugin apllied and IDE can't see a closure to configure it in the scope of this project.