Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.checkstyle.configuration with url pointing to google checks does not work #188

Closed
manastalukdar opened this issue Jul 28, 2019 · 5 comments
Labels
Milestone

Comments

@manastalukdar
Copy link

CheckStyle: 1.0.3

VSCode and Platform:

Version: 1.37.0-insider (user setup)
Commit: 6d82826e990407364d5c829b73602a19ecdf7d00
Date: 2019-07-26T05:37:26.606Z
Electron: 4.2.7
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Windows_NT x64 10.0.18362

As per the documentation java.checkstyle.configuration supports URLs.

Setting:

"java.checkstyle.configuration": "https://raw.githubusercontent.com/checkstyle/checkstyle/master/src/main/resources/google_checks.xml"

This results in the following CheckStyle error (formatted for readability):

{"message":"cannot initialize module TreeWalker - cannot initialize module InvalidJavadocPosition - Unable to instantiate 'InvalidJavadocPosition' class, it is also not possible to instantiate it as .InvalidJavadocPosition, InvalidJavadocPositionCheck, .InvalidJavadocPositionCheck.
Please recheck that class name is specified as canonical name or read how to configure short name usage https://checkstyle.org/config.html#Packages. Please also recheck that provided ClassLoader to Checker is configured correctly."}
@jdneo
Copy link
Owner

jdneo commented Jul 28, 2019

Seems that the embedded checkstyle version needs to be upgraded.

@jdneo
Copy link
Owner

jdneo commented Jul 29, 2019

Hi @manastalukdar,

The root cause is that CheckStyle has some breaking changes from 8.18 to 8.23.

The workaround is to change the URL to: https://raw.githubusercontent.com/checkstyle/checkstyle/checkstyle-8.18/src/main/resources/google_checks.xml

@manastalukdar
Copy link
Author

manastalukdar commented Jul 29, 2019

@jdneo Thanks. Is this extension going to support CheckStyle v8.23 at some point?

@jdneo
Copy link
Owner

jdneo commented Jul 29, 2019

@manastalukdar I'm still considering the best way to solve this problem. Since using 8.23 will break some previous rules as well.

A better solution might be allowing users to config the version by himself, just as this issue says: #172

@Vigilans Vigilans added this to the 1.3.0 milestone Sep 25, 2019
@jdneo
Copy link
Owner

jdneo commented Sep 27, 2019

@manastalukdar we have added the support to dynamically select Checkstyle version. Please wait for the next release, which will be shipped recently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants