vscode-checkstyle
vscode-checkstyle copied to clipboard
Checkstyle extension for VS Code
Checkstyle for VS Code
Check your Java code format and fix it!
Requirements
- JDK (version 17 or later)
- VS Code (version 1.30.0 or later)
- Language Support for Java by Red Hat
Quick Start

Features
Set Checkstyle Configuration File

-
To set the configuration file, Just Right click the
.xmlfile and selectSet the Checkstyle Configuration File. -
You can also trigger the command Checkstyle: Set Checkstyle Configuration File to choose the configuration file in the File Explorer. The extension will automatically detect and list the Checkstyle configuration files in your workspace. Besides that, you will also see the two built-in configurations:
- Google's Check
- Sun's Check
Set Checkstyle Version
.gif)
- You can use the command
Checkstyle: Set the Checkstyle Versionto manually set the Checkstyle version according to your project preferences. The extension will automatically download the required jar files if they do not exist locally.
Note: If you don't know which
Checkstlyeversion is used byMaven Checkstyle Plugin, check this table.
Check the Style and Fix the Violations

- When editing a Java file, the extension will check the file format and provide quick fixes if possible. You can click the
button in the editor to show the available quick fixes.
Settings
| Setting Name | Description | Default Value |
|---|---|---|
java.checkstyle.version |
Specify the Checkstyle Version. | 9.3 |
java.checkstyle.configuration |
Specify the path of the Checkstyle configuration file. The path can either be a local file path or a URL. | "" |
java.checkstyle.properties |
Specify the customized properties used in the Checkstyle configuration. | {} |
java.checkstyle.modules |
Specify the third-party modules used for Checkstyle. | [] |
java.checkstyle.autocheck |
Specify if the extension will check the format automatically or not. | true |
Note: You can use the
${workspaceFolder}to represent the path of the workspace folder of the file to be checked. For example:
"java.checkstyle.modules": [
"${workspaceFolder}/src/main/resources/sevntu-checks-1.35.0.jar"
]
or
"java.checkstyle.properties": {
"basedir": "${workspaceFolder}"
}
Release Notes
Refer to CHANGELOG.md