palantir-java-format icon indicating copy to clipboard operation
palantir-java-format copied to clipboard

IntelliJ palantir-java-format plugin doesn't organize imports

Open jknocek opened this issue 6 months ago • 2 comments

My team is attempting to utilize the palantir java formatter in conjunction with Gradle and Spotless. Executing ./gradlew spotlessApply works great, and formats our files as expected.

Additionally, we've installed the palantir-java-format IntelliJ plugin which auto-formats my Java files on save so that we don't need to manually execute spotlessApply prior to every commit. The plugin executes the palantir formatter on save, however we've found that it doesn't organize imports or remove unused imports.

Checking the File | Settings | Tools | Actions on Save | Optimize imports checkbox does appear to organize our imports, but it doesn't respect the palantir import structure, and seems to instead utilize IntelliJ's code style import config. This appears to be the opposite behavior from the Reformat code checkbox which ignores the IntelliJ code style config, and forces the palantir formatter.

jknocek avatar Jul 08 '25 02:07 jknocek

+1, also experiencing this issue.

Kenert avatar Oct 07 '25 10:10 Kenert

This is still an issue. It would be great for the plugin to use your project configuration eventually. That way, it would always match ./gradlew spotlessApply or mvn spotless:apply.

tsposato avatar Nov 05 '25 22:11 tsposato