Skip to content

IntelliJ palantir-java-format plugin doesn't organize importsΒ #1352

@jknocek

Description

@jknocek

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions