RFR: 6639: Adding spotless for the rest of the java code
hirt at openjdk.java.net
Wed Nov 27 23:15:08 UTC 2019
On Wed, 27 Nov 2019 22:59:19 GMT, Marcus Hirt <hirt at openjdk.org> wrote:
> On Wed, 27 Nov 2019 22:53:36 GMT, Henrik Dafgård <hdafgard at openjdk.org> wrote:
>> On Wed, 27 Nov 2019 21:43:48 GMT, Marcus Hirt <hirt at openjdk.org> wrote:
>>> Note that you need to run with -Puitests to include the uitests for the spotless analysis.
>>> - ca9cbb8b: Spotless for the uitests
>>> - f00eae06: Enabling spotless for everything but uitests (coming next)
>>> - 3ce3862f: 6639: Spotless for all Java projects - initial cleanup
>>> Changes: https://git.openjdk.java.net/jmc/pull/8/files
>>> Webrev: https://webrevs.openjdk.java.net/jmc/8/webrev.00
>>> Issue: https://bugs.openjdk.java.net/browse/JMC-6639
>>> Stats: 1406 lines in 289 files changed: 757 ins; 110 del; 539 mod
>>> Patch: https://git.openjdk.java.net/jmc/pull/8.diff
>>> Fetch: git fetch https://git.openjdk.java.net/jmc pull/8/head:pull/8
>> application/org.openjdk.jmc.flightrecorder.controlpanel.ui/src/main/java/org/openjdk/jmc/flightrecorder/controlpanel/ui/ControlPanel.java line 127:
>>> 126: IPath lastFolder = lastPathStr.isEmpty() ? IDESupportToolkit.getDefaultRecordingFolder()
>>> 127: : Path.fromOSString(lastPathStr).removeLastSegments(1);
>> I actually kind of like this one. Can spotless be configured to allow separating ternary operations like the old style? If they can't be on one line or three then maybe they should be expanded to if/else statements? Having it on just two lines makes it a little bit harder to see what's going on.
> There are a few cases where the formatting gets a bit worse, agreed. Not too many, and it usually has to do with line breaks. I think the two choices for these are to either make the formatter weaker (i.e. not touch explicit line breaks the user has entered), or increase the maximum line length.
I think I can live with this one. Let me know if you disagree!
More information about the jmc-dev