New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 866986 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

clang-format quality problem: brace-style list with line continuations

Project Member Reported by rsesek@chromium.org, Jul 24

Issue description

clang-format produced code that (choose all that apply): 
- Riles my finely honed stylistic dander
- No sane human would ever choose

Here's the code before formatting:
n/a

Here's the code after formatting:

  base::scoped_nsobject<NSMenuItem> item =
      Item(IDS_APP_MENU_PRODUCT_NAME)
          .tag(IDC_CHROME_MENU)
          .submenu({
            Item(IDS_ABOUT_MAC)
                .string_format_1(IDS_PRODUCT_NAME)
                .tag(IDC_ABOUT)
                .target(app_controller)
                .action(@selector(orderFrontStandardAboutPanel:)),
                Item().is_separator(),
                Item(IDS_PREFERENCES)
                    .tag(IDC_OPTIONS)
                    .target(app_controller)
                    .action(@selector(showPreferences:)),
                Item().is_separator(),

Here's how it ought to look:

  base::scoped_nsobject<NSMenuItem> item =
      Item(IDS_APP_MENU_PRODUCT_NAME)
          .tag(IDC_CHROME_MENU)
          .submenu({
            Item(IDS_ABOUT_MAC)
                .string_format_1(IDS_PRODUCT_NAME)
                .tag(IDC_ABOUT)
                .target(app_controller)
                .action(@selector(orderFrontStandardAboutPanel:)),
            Item().is_separator(),
            Item(IDS_PREFERENCES)
                .tag(IDC_OPTIONS)
                .target(app_controller)
                .action(@selector(showPreferences:)),
            Item().is_separator(),


Code review link for full files/context:
https://chromium-review.googlesource.com/c/chromium/src/+/1147157/6/chrome/browser/ui/cocoa/main_menu_builder.mm#33

It looks clang-format is mixing the continuation-line 4-space indent rule with keep-list-of-things-aligned-at-same-indent.
 
Status: Assigned (was: Untriaged)
This bug has an owner, thus, it's been triaged. Changing status to "assigned".
Labels: clang-format

Sign in to add a comment