palantir / palantir-java-format

A modern, lambda-friendly, 120 character Java formatter.
Apache License 2.0
403 stars 43 forks source link

IntelliJ-Plugin: Line break is added for empty record #1075

Closed marschwar closed 2 months ago

marschwar commented 2 months ago

What happened?

First of all thanks for your work. After upgrading from IntelliJ Ulitmate from 2023.3.6 -> 2024.1, I noticed that records without a body are formatted differently.

Plugin Version:

// IntelliJ 2023.3.6
public record MyRecord(String name) {}
// IntelliJ 2024.1
public record MyRecord(String name) {
}

For the latter one the command ./gradlew spotlessJavaCheck fails.

What did you want to happen?

I would like the IntelliJ plugin and the spotless checkt to produce the same results. Is there any workaround to achieve this?

ash211 commented 2 months ago

Possibly related to https://github.com/palantir/palantir-java-format/issues/1068