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