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

Issue 764581 link

Starred by 1 user

Issue metadata

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



Sign in to add a comment

clang-format quality problem

Project Member Reported by ntfschr@chromium.org, Sep 13 2017

Issue description

clang-format produced code that (choose all that apply): 
X Doesn't match Chromium style
- Doesn't match blink style
- Riles my finely honed stylistic dander
X No sane human would ever choose

*Note* this is Java code, specific to Java lambda expressions.

Here's the code before formatting:
            getUserOptInPreference.invoke(null, appContext,
                    (Callback<Boolean>) optin -> setSafeBrowsingUserOptIn(
                            optin == null ? false : optin));

Here's the code after formatting:
            getUserOptInPreference.invoke(null, appContext,
                    (Callback<Boolean>)
                            optin -> setSafeBrowsingUserOptIn(optin == null ? false : optin));

Here's how it ought to look:
Same as "before formatting", or anything else that complies with `git cl presubmit`.

Code review link for full files/context:
After running `git cl presubmit`, I get output like:

android_webview/java/src/org/chromium/android_webview/AwSafeBrowsingConfigHelper.java:45: 'lambda arguments' has incorrect indentation level 28, expected level should be one of the following: 16, 20.

Not sure if this is a bug with `git cl presubmit` or `git cl format`.
 
CL: https://chromium-review.googlesource.com/c/chromium/src/+/664182 (search for this bug number)
Components: Tools
Labels: clang-format
Labels: Pri-2
Setting defect without priority to Pri-2.

Sign in to add a comment