jdneo / vscode-checkstyle

Checkstyle extension for VS Code
https://marketplace.visualstudio.com/items?itemName=shengchen.vscode-checkstyle
GNU Lesser General Public License v3.0
68 stars 15 forks source link

Property ${config_loc} has not been set #277

Closed Abhi347 closed 4 years ago

Abhi347 commented 4 years ago

Hi, I am using this extension for running a Springboot project generated in IntelliJ IDEA. The checkstyle.xml has the following suppression filter set

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

And when I try to use this extension I always get the following error message -

{"message":"unable to parse configuration stream","cause":{"message":"com.puppycrawl.tools.checkstyle.api.CheckstyleException: Property ${config_loc} has not been set"}}

Which I assume is because the config_loc property is not. set in the extension currently. This property is set by checkstyle plugins on both Eclipse and IntelliJ. Is there any way to set this property in the extension? If not, can you consider adding this option?

Related issues:
https://github.com/jshiell/checkstyle-idea/issues/217 https://github.com/checkstyle/checkstyle/issues/2976

jdneo commented 4 years ago

Yes you can add a VS Code setting to set this field:

"java.checkstyle.properties": {
    "config_loc": "${workspaceFolder}/XXXXXX"
}
Abhi347 commented 4 years ago

Thanks @jdneo ! It works.