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

Issue 651609 link

Starred by 2 users

Issue metadata

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



Sign in to add a comment

`git cl format` should remove braces around single-line clauses

Project Member Reported by lgar...@chromium.org, Sep 29 2016

Issue description

A lot of reviewers nit and tell other to remove braces around single-line clauses.

I personally prefer braces for safety (*ahem* goto: fail) and clarity, but consistency is more important. The style guide considers them optional, but so many reviewers comment on it that it might as well be required.

Developers should not need to think about stuff like this; that's the whole point of `git cl format`.

Therefore, I propose that `git cl format` should just pick the common convention and apply it.
 
Cc: jparent@chromium.org
jparent@, I don't know where to send this; could you help triage?
+1 to not needing to think about this!
Before we change the tool, we'd need agreement to change the style guide and policy.  We can't enforce a not-agreed upon policy.

To address that, I think you'd need to write a proposal to the folks who are responsible for the style guide?
> To address that, I think you'd need to write a proposal to the folks who are responsible for the style guide?

My proposal is reviewers should stop bothering me to remove braces as long as the style guide doesn't require it. :-P

Is there a "developer productivity" person/team I can ask to take this on?
If not, what's the least time-consuming way to submit a proposal to those folks?
Aaron, do you have any thoughts on this?

Comment 6 by aga...@chromium.org, Nov 16 2017

Cc: aga...@chromium.org
Components: -Infra>SDK
Owner: lgar...@chromium.org
Status: Assigned (was: Untriaged)
git-cl-format is literally just "find the list of modified files, find the clang-format binary, run clang-format on those files".

git-cl-format does not have any control over what kind of formatting is done, what style rules are adhered to, or anything like that. All of that is controlled by the .clang-format files in each repo:
https://cs.chromium.org/search/?q=.clang-format&sq=package:chromium

That file delegates basically all decisions to clang-format's built-in "Chromium" style, which is defined in the clang-format repo itself. As far as I know, any chrome developer is welcome to propose changes to that file either via a CL or via a proposal on chromium-dev@.
Owner: ----
Status: Available (was: Assigned)
lgarron isn't working on Chrome anymore, but someone else might want to pick this up.
Project Member

Comment 8 by sheriffbot@chromium.org, Dec 3

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment