checkstyle-idea
checkstyle-idea copied to clipboard
Export Checkstyle Config To Project
I am currently using the Bundled Google Checks and I want to import it into IDEA for formatting (https://github.com/jshiell/checkstyle-idea/issues/126) and also be able to run checkstyle from Gradle.
There doesn't seem to be an obvious way to export or save the checkstyle config to a file to do this.
I could just download it manually (https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml) but it would be nicer to have the option built into the plugin.
Until we have a button for this, you can either:
- Download from GitHub (but be sure to add the Checkstyle version number!), e.g. https://raw.githubusercontent.com/checkstyle/checkstyle/checkstyle-8.12/src/main/resources/google_checks.xml
- Copy from the installed Checkstyle-IDEA plugin. Again note the Checkstyle version that you are using and open the corresponding Checkstyle JAR. The google_checks.xml is in its root.
On Windows, the JAR would be at %HOME%\.IntelliJIdea2018.2\config\plugins\CheckStyle-IDEA\checkstyle\lib\checkstyle-8.12.jar (for version 8.12).
The Checkstyle version is important because the config file syntax changes frequently, options are added and removed etc.