clang-format removes a newline in Java in method call, breaks alignment |
||||
Issue description
clang-format produced code that (choose all that apply):
- Riles my finely honed stylistic dander
Here's the code before formatting:
assertThat(mMockNotificationManager.getNotificationChannelIds(),
containsInAnyOrder(ChannelDefinitions.CHANNEL_ID_BROWSER,
ChannelDefinitions.CHANNEL_ID_DOWNLOADS,
ChannelDefinitions.CHANNEL_ID_INCOGNITO,
ChannelDefinitions.CHANNEL_ID_SITES,
ChannelDefinitions.CHANNEL_ID_MEDIA));
Here's the code after formatting:
assertThat(mMockNotificationManager.getNotificationChannelIds(),
containsInAnyOrder(ChannelDefinitions.CHANNEL_ID_BROWSER,
ChannelDefinitions.CHANNEL_ID_DOWNLOADS,
ChannelDefinitions.CHANNEL_ID_INCOGNITO,
ChannelDefinitions.CHANNEL_ID_SITES, ChannelDefinitions.CHANNEL_ID_MEDIA));
Here's how it ought to look:
assertThat(mMockNotificationManager.getNotificationChannelIds(),
containsInAnyOrder(ChannelDefinitions.CHANNEL_ID_BROWSER,
ChannelDefinitions.CHANNEL_ID_DOWNLOADS,
ChannelDefinitions.CHANNEL_ID_INCOGNITO,
ChannelDefinitions.CHANNEL_ID_SITES,
ChannelDefinitions.CHANNEL_ID_MEDIA));
Code review link for full files/context:
https://codereview.chromium.org/2832433002/diff/1/chrome/android/junit/src/org/chromium/chrome/browser/notifications/ChannelsUpdaterTest.java
,
Apr 19 2017
This is called "bin packing", see BinPackParameters / BinPackArguments in https://clang.llvm.org/docs/ClangFormatStyleOptions.html We set that to false for c++ for chromium style (http://llvm-cs.pcc.me.uk/tools/clang/lib/Format/Format.cpp#660) but not for Java -- iirc the android style guide said to not do that somewhere.
,
Oct 26 2017
,
Nov 27
,
Jan 11
Issue has a component, but no priority. Updating to have default priority (Pri-2) |
||||
►
Sign in to add a comment |
||||
Comment 1 by awdf@chromium.org
, Apr 19 2017