-
Notifications
You must be signed in to change notification settings - Fork 1
Checkstyle
Are you a backend developer frequently facing checkstyle errors during commits? This guide will show you how to configure IntelliJ IDEA to automatically correct many of these errors using the CheckStyle-IDEA plugin.
Install the plugin from the IntelliJ plugin marketplace to integrate Checkstyle into your IDE.

Navigate to Settings -> Tools -> Checkstyle. Click the plus (+) icon in Configuration file section and select Use a local Checkstyle file. Locate your configuration file at PROJECT_DIR/config/checkstyle/checkstyle.xml. Enable the configuration by checking the box next to the newly added file.

Access Settings -> Editor -> Code Style. Click the gear icon (⚙️) next to Scheme, then select Import Scheme -> Checkstyle Configuration.

During development, regularly use Code -> Reformat Code and Code -> Optimize Imports from the IntelliJ IDEA menu. These features will automatically adjust your code to meet most of the Checkstyle rules. Manual adjustments might still be necessary for some specific cases.