Skip to content

UnnecessaryParentheses should keep line breaks #219

@koppor

Description

@koppor

This is more a discussion.

I am applying prettier-java to my project (JabRef/jabref#10646). It turned out best (in comparison to GJF, palantir-java, spring-java-style). It has very good review-friendly line wrapping.

UnnecessaryParentheses undoes newlines in some cases

-        sb.append(
-            StringUtil.quote(
+        sb.append(StringUtil.quote(
...
            stringBuilder.append(
-                style.getNumCitationMarkerForBibliography(citedKey).toString()
+            stringBuilder.append(style.getNumCitationMarkerForBibliography(citedKey).toString()

Is it possible to turn-off this behavior - or move that behavior to another rule (maybe "ObsoleteNewLines", "CompressCode", ...)?


Link to failing test: https://github.com/JabRef/jabref/actions/runs/6905905922/job/18789707499?pr=10646

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions