The Spotless Applier IntelliJ Plugin enhances your development workflow by seamlessly integrating Spotless Gradle and Maven tasks directly within the IntelliJ IDE. With this plugin, you can easily apply code formatting and style enforcement to your projects, either for the current file you're working on or for the entire project.
Actions | Shortcuts (Windows) | Shortcuts (MacOS) |
---|---|---|
Code > Reformat File With Spotless | Ctrl+Alt+; | ⌘Сmd+⌥Opt+; |
Code > Reformat Project With Spotless | Ctrl+Alt+Shift+; | ⌘Сmd+⌥Opt+⇧Shift+; |
✔️ Supports multi-module projects
The plugin also offers a commit check to automatically apply Spotless formatting.
To enable this feature, navigate to Settings
> Version Control
> Commit
and activate Reformat code with Spotless
To access plugin settings, go to: Settings
> Tools
> Spotless Applier
Allow Gradle cache for 'apply' task
> Starting from version 6.0.0, Spotless supports Gradle's configuration cache. If you want to use it, please enable this checkbox.Optimize imports before applying
> Enable this option to additionally execute IntelliJ IDEA's default "optimize imports" task before applying Spotless formatting.Prohibit imports with asterisk '*'
> Prevents imports with the asterisk symbol during the "optimize imports" task. When enabled, any imports that use the '*' symbol to import all classes from a package will be replaced with FQN.
Settings/Preferences > Plugins > Marketplace > Search for "Spotless Applier" > Install Plugin
Download the latest release and install it manually using Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...
This plugin resolve your current build tool by searching the pom.xml
(Maven) or .gradle
(Gradle) files in project's root folder.
After that, it runs the spotless:apply
or spotlessApply
task.
For applying changes only for current file it uses:
- Maven Specific files
- Gradle Spotless IDE hook
Thanks to Ryan Gurney for his Spotless IntelliJ Gradle plugin which I used as the basis for this plugin.
See CONTRIBUTING.md
See CHANGELOG.md
See License