Search code examples
javaspotless

How to configure spotless google formatter to format braces


How to configure spotless google formatter to format braces in 2 lines instead of a single line

-    void contextLoads() {}
+    void contextLoads() {
+    }

Solution

  • You can't. From google-java-format's README:

    Note: There is no configurability as to the formatter's algorithm for formatting. This is a deliberate design decision to unify our code formatting on a single format.