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

Issue 768551 link

Starred by 1 user

Issue metadata

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

Blocked on:
issue 768576



Sign in to add a comment

clang-format reformats code in way that doesn't pass presubmit

Project Member Reported by mpear...@chromium.org, Sep 25 2017

Issue description


I started out with the following single-line Java code:
        ThreadUtils.runOnUiThreadBlocking(() -> { urlBar.getInputConnection().commitText("a", 1); });

When trying to upload the patch, I get presubmit errors:
** Presubmit ERRORS **
chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/UrlBarTest.java:434: Line is longer than 100 characters (found 101).

This makes sense.  Let me format it.

git cl format gives me
        ThreadUtils.runOnUiThreadBlocking(
+               () -> { urlBar.getInputConnection().commitText("a", 1); });

Okay, looks reasonable.  Committed to my local repository.

Now try to upload.

Nope, now different errors:
** Presubmit ERRORS **
  chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/UrlBarTest.java:435:23: '{' at column 23 should have line break after.

Uh, hmmm.

Okay, let's try that manually, adding a line break.
        ThreadUtils.runOnUiThreadBlocking(
                () -> {
                    urlBar.getInputConnection().commitText("a", 1);
                });

It turns out I can upload this patch.  I get a mere presubmit warning.
** Presubmit Warnings **
The src directory requires source formatting. Please run git cl format .

Okay, I'll upload anyway and submit that way.

But what happens if I run "git cl format"?

It reverts the code formatting back to two-line definition above that generate a presubmit error.

 

Comment 1 by thakis@chromium.org, Sep 25 2017

Blockedon: 768576
Components: Tools
Labels: clang-format

Sign in to add a comment