clang-format quality problem - bad linewrap |
|||
Issue description
clang-format produced code that (choose all that apply):
- No sane human would ever choose
Here's the code before formatting:
Notification notification = new CustomNotificationBuilder(context)
.setSmallIcon(R.drawable.ic_chrome)
.setLargeIcon(largeIcon)
.setTitle("title")
.setBody("body")
.setOrigin("origin")
.setTicker("ticker")
.setDefaults(Notification.DEFAULT_ALL)
.setVibrate(new long[] {100L})
.setContentIntent(contentIntent)
.setDeleteIntent(deleteIntent)
.addButtonAction(actionIcon, "button",
createIntent(context, "ActionButtonOne"))
.addButtonAction(actionIcon, "button",
createIntent(context, "ActionButtonTwo"))
.addSettingsAction(0 /* iconId */, "settings",
createIntent(context, "SettingsButton"))
.build();
Here's the code after formatting:
Notification notification = new CustomNotificationBuilder(
context).setSmallIcon(R.drawable.ic_chrome)
.setLargeIcon(largeIcon)
.setTitle("title")
.setBody("body")
.setOrigin("origin")
.setTicker("ticker")
.setDefaults(Notification.DEFAULT_ALL)
.setVibrate(new long[] {100L})
.setContentIntent(contentIntent)
.setDeleteIntent(deleteIntent)
.addButtonAction(actionIcon, "button",
createIntent(context, "ActionButtonOne"))
.addButtonAction(actionIcon, "button",
createIntent(context, "ActionButtonTwo"))
.addSettingsAction(0 /* iconId */, "settings",
createIntent(context, "SettingsButton"))
.build();
Here's how it ought to look:
As it was before formatting, or potentially:
Notification notification =
new CustomNotificationBuilder(context)
.setSmallIcon(R.drawable.ic_chrome)
.setLargeIcon(largeIcon)
.setTitle("title")
.setBody("body")
.setOrigin("origin")
.setTicker("ticker")
.setDefaults(Notification.DEFAULT_ALL)
.setVibrate(new long[] {100L})
.setContentIntent(contentIntent)
.setDeleteIntent(deleteIntent)
.addButtonAction(actionIcon, "button",
createIntent(context, "ActionButtonOne"))
.addButtonAction(actionIcon, "button",
createIntent(context, "ActionButtonTwo"))
.addSettingsAction(0 /* iconId */, "settings",
createIntent(context, "SettingsButton"))
.build();
Code review link for full files/context:
https://codereview.chromium.org/2337963003/diff/120001/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilderTest.java
,
Aug 1
,
Nov 27
Notification notification = new CustomNotificationBuilder(context)
.setSmallIcon(R.drawable.ic_chrome)
.setLargeIcon(largeIcon)
.setTitle("title")
.setBody("body")
.setOrigin("origin")
.setTicker("ticker")
.setDefaults(Notification.DEFAULT_ALL)
.setVibrate(new long[] {100L})
.setContentIntent(contentIntent)
.setDeleteIntent(deleteIntent)
.addButtonAction(actionIcon, "button",
createIntent(context, "ActionButtonOne"))
.addButtonAction(actionIcon, "button",
createIntent(context, "ActionButtonTwo"))
.addSettingsAction(0 /* iconId */, "settings",
createIntent(context, "SettingsButton"))
.build();
|
|||
►
Sign in to add a comment |
|||
Comment 1 by dtapu...@chromium.org
, Oct 26 2017