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

Issue 738181 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

git cl format is non-idempotent wrt inserting line breaks

Reported by jwo...@igalia.com, Jun 29 2017

Issue description

depot_tools version: c833946a1fb6bf7bab355433faeff98d4531e1b5
OS: Linux

What steps will reproduce the problem?
Context: https://chromium-review.googlesource.com/c/529973/5/src%252Fflag-definitions.h#208

Start with this code:

```
#define HARMONY_INPROGRESS(V) HARMONY_INPROGRESS_BASE(V) V(harmony_number_format_to_parts, "Intl.NumberFormat.prototype.formatToParts")
```

`git cl format` formats it like this:

```
#define HARMONY_INPROGRESS(V)       \
  HARMONY_INPROGRESS_BASE(V)        \
  V(harmony_number_format_to_parts, \
    "Intl.NumberFormat.prototype.formatToParts")

```

but then, if you run `git cl format` again, it changes it to this:

```
#define HARMONY_INPROGRESS(V)                                      \
  HARMONY_INPROGRESS_BASE(V)                                       \
  V(harmony_number_format_to_parts, "Intl.NumberFormat.prototype." \
                                    "formatToParts")
```

and then again, becomes this:

```
#define HARMONY_INPROGRESS(V)       \
  HARMONY_INPROGRESS_BASE(V)        \
  V(harmony_number_format_to_parts, \
    "Intl.NumberFormat.prototype."  \
    "formatToParts")
```

This is a bit problematic in this specific case because `d8 --help` shows the break in the string literal due to how that value is being used by the preprocessor macro framework.

 

Sign in to add a comment