RFC: Mass Reformat with google-java-format

109 views
Skip to first unread message

Andrew Grieve

unread,
Sep 25, 2023, 3:30:18 PM9/25/23
to java
Context:

You can try out google-java- format via:
third_party/google-java-format/google-java-format --aosp --replace file1.java file2.java ...

or on your modified files via:
git cl format --google-java-format

I've also posted a collection of things that are different here:'

Proposal:
google-java-format does a good job at changing only modified lines, so it is certainly an option to switch to it from clang-format without a mass-reformat. However, I'd like to avoid the following pattern:
1. Change formatter, don't mass reformat
2. Wait 6 months
3. The style within files becomes more and more inconsistent, and someone proposes a mass-reformat.

So, I'd like to propose that we go ahead with a mass-reformat when switching formatters.

Please let me know if you have reasons for / against a mass reformat of our Java code.


Andrew Grieve

unread,
Oct 3, 2023, 3:15:02 PM10/3/23
to Andrew Grieve, java
I've flipped the switch to enable google-java-format for "git cl format".

I'll also plan to mass-reformat tests next week unless there is strong opposition to the idea.

Reply all
Reply to author
Forward
0 new messages