You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Keep an author-written argument table even when later columns are not of one kind #158
palantir-java-format#1783 (closed unmerged on 2026-10-17) notes that the tabular-arguments heuristic keeps a grid of arguments only if column 0 is uniform and every other column has a majority of one expression kind. A values column mixing a sum, an identifier and a method call has no majority, so the grid collapses onto one line, while an almost identical call with uniform values keeps its table. The PR drops the check for columns after the first; column 0 and all row-length and start-column rules stay. The only existing golden that changes is the paired-arguments test.
Why it matters to us: we have the same two checks in argumentsAreTabular (around lines 3366-3370 of JavaInputAstVisitor), so identical inputs give inconsistent results today. It only ever keeps a table the author already wrote, so risk is low, but it changes an existing golden file and diverges from palantir.
Affected files: open-java-format/src/main/java/com/palantir/javaformat/java/JavaInputAstVisitor.java, the PairedArguments test data.
Before (upstream behaviour before the change; our code has the same check, not run):
assertThat("alpha", first + second, "bravo", someVariable, "charlie", compute(), "delta", other + thing);
After (with the change, input written as a grid):
assertThat(
"alpha", first + second,
"bravo", someVariable,
"charlie", compute(),
"delta", other + thing);
Suggested action: adopt-the-idea if we want consistent table handling; low priority.
Filed from an upstream-watch ticket after manual review.
Activity