You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by Yong Tang <yo...@outlook.com> on 2016/03/17 18:41:46 UTC

Upgrade to clang-format-3.8

Hi All


This email is to announce that the default configuration and the recommended version of the clang-format is being upgraded to 3.8 (from 3.5) in mesos.


In clang-format-3.8, the newly introduced option "AlignAfterOpenBracket: AlwaysBreak" closes the largest gap between ClangFormat and the style guide in mesos. It avoids  "jaggedness" in function calls and is worth migrating for.


Along with the changes in clang-format configuration (support/clang-format), the documentation (docs/clang-format.md) is also going to be updated to reflect changes in version and the recommended installation process.


More details about this upgrade could be found in MESOS-4906 (https://issues.apache.org/jira/browse/MESOS-4906). By the way, thanks Michael for the help on this issue.


Thanks


Yong


 		 	   		  

Re: Upgrade to clang-format-3.8

Posted by James Peach <jo...@gmail.com>.
> On Mar 18, 2016, at 10:22 AM, Michael Park <mp...@apache.org> wrote:
> 
> Hi James,
> 
> Someone would need to propose to auto-format everything with clang-format
> and convince the community
> that while clang-format will never be perfect, it generates a systematic,
> sane and just as readable codebase.
> If we can reach consensus on that, we could add it as a commit hook and no
> one will worry about formatting.
> 
> I dreamed of the world described above, but at least at the time
> clang-format was still learning about some
> of the C++11 constructs (especially around lambdas), so it seemed a bit too
> far fetched.
> 
> My goal with clang-format currently is for people to have it integrated in
> their editors to help them get 80, 90%
> of the way there with single key-stroke, then follow-up with necessary
> minor edits.

Yeh the current config did help me get a start on the correct style. Unfortunately you can only run it once otherwise it eats it again. To deal with whitespace, IMHO the best approach is to automatically run git-stripspace and do without the double-blanks :)

> We've been converging from
> both sides to get that percentage higher (new features in clang-format +
> modifying our style), and we'll continue
> to make such efforts where it makes sense.
> 
> MPark
> 
> On 18 March 2016 at 12:45, James Peach <jo...@gmail.com> wrote:
> 
>> 
>>> On Mar 17, 2016, at 10:41 AM, Yong Tang <yo...@outlook.com>
>> wrote:
>>> 
>>> Hi All
>>> 
>>> 
>>> This email is to announce that the default configuration and the
>> recommended version of the clang-format is being upgraded to 3.8 (from 3.5)
>> in mesos.
>>> 
>>> 
>>> In clang-format-3.8, the newly introduced option "AlignAfterOpenBracket:
>> AlwaysBreak" closes the largest gap between ClangFormat and the style guide
>> in mesos. It avoids  "jaggedness" in function calls and is worth migrating
>> for.
>>> 
>>> 
>>> Along with the changes in clang-format configuration
>> (support/clang-format), the documentation (docs/clang-format.md) is also
>> going to be updated to reflect changes in version and the recommended
>> installation process.
>>> 
>>> 
>>> More details about this upgrade could be found in MESOS-4906 (
>> https://issues.apache.org/jira/browse/MESOS-4906). By the way, thanks
>> Michael for the help on this issue.
>> 
>> This sounds really promising. Is the plan to auto-format everything with
>> clang-format?


Re: Upgrade to clang-format-3.8

Posted by Michael Park <mp...@apache.org>.
Hi James,

Someone would need to propose to auto-format everything with clang-format
and convince the community
that while clang-format will never be perfect, it generates a systematic,
sane and just as readable codebase.
If we can reach consensus on that, we could add it as a commit hook and no
one will worry about formatting.

I dreamed of the world described above, but at least at the time
clang-format was still learning about some
of the C++11 constructs (especially around lambdas), so it seemed a bit too
far fetched.

My goal with clang-format currently is for people to have it integrated in
their editors to help them get 80, 90%
of the way there with single key-stroke, then follow-up with necessary
minor edits. We've been converging from
both sides to get that percentage higher (new features in clang-format +
modifying our style), and we'll continue
to make such efforts where it makes sense.

MPark

On 18 March 2016 at 12:45, James Peach <jo...@gmail.com> wrote:

>
> > On Mar 17, 2016, at 10:41 AM, Yong Tang <yo...@outlook.com>
> wrote:
> >
> > Hi All
> >
> >
> > This email is to announce that the default configuration and the
> recommended version of the clang-format is being upgraded to 3.8 (from 3.5)
> in mesos.
> >
> >
> > In clang-format-3.8, the newly introduced option "AlignAfterOpenBracket:
> AlwaysBreak" closes the largest gap between ClangFormat and the style guide
> in mesos. It avoids  "jaggedness" in function calls and is worth migrating
> for.
> >
> >
> > Along with the changes in clang-format configuration
> (support/clang-format), the documentation (docs/clang-format.md) is also
> going to be updated to reflect changes in version and the recommended
> installation process.
> >
> >
> > More details about this upgrade could be found in MESOS-4906 (
> https://issues.apache.org/jira/browse/MESOS-4906). By the way, thanks
> Michael for the help on this issue.
>
> This sounds really promising. Is the plan to auto-format everything with
> clang-format?

Re: Upgrade to clang-format-3.8

Posted by Cong Wang <cw...@twopensource.com>.
On Fri, Mar 18, 2016 at 10:19 AM, Yong Tang
<yo...@outlook.com> wrote:
> Hi James
>
> My understanding is that there are two epic associated. One is the clang-format integration that formatting whitespaces, multiple lines, etc. Another is the clang-tidy integration that helps handle class/function naming conventions etc..

This is needed sooner than later. I once opened
https://issues.apache.org/jira/browse/MESOS-3523
when people keep wasting time on whitespaces, new lines etc.
on review board.

It needs to be integrated with git hooks too like cpplint,
so people don't need to worry/argue/review coding styles.

It is not that coding styles are not important, quite oppositely,
it is too important that we can't rely on humans to review them. :)

I can't wait for this.

RE: Upgrade to clang-format-3.8

Posted by Yong Tang <yo...@outlook.com>.

> Subject: Re: Upgrade to clang-format-3.8
> From: jorgar@gmail.com
> Date: Fri, 18 Mar 2016 09:45:22 -0700
> To: dev@mesos.apache.org
> 
> 
> > On Mar 17, 2016, at 10:41 AM, Yong Tang <yo...@outlook.com> wrote:
> > 
> > Hi All
> > 
> > 
> > This email is to announce that the default configuration and the recommended version of the clang-format is being upgraded to 3.8 (from 3.5) in mesos.
> > 
> > 
> > In clang-format-3.8, the newly introduced option "AlignAfterOpenBracket: AlwaysBreak" closes the largest gap between ClangFormat and the style guide in mesos. It avoids  "jaggedness" in function calls and is worth migrating for.
> > 
> > 
> > Along with the changes in clang-format configuration (support/clang-format), the documentation (docs/clang-format.md) is also going to be updated to reflect changes in version and the recommended installation process.
> > 
> > 
> > More details about this upgrade could be found in MESOS-4906 (https://issues.apache.org/jira/browse/MESOS-4906). By the way, thanks Michael for the help on this issue.
> 
> This sounds really promising. Is the plan to auto-format everything with clang-format?

Hi James

My understanding is that there are two epic associated. One is the clang-format integration that formatting whitespaces, multiple lines, etc. Another is the clang-tidy integration that helps handle class/function naming conventions etc.. 

clang-format integration:
https://issues.apache.org/jira/browse/MESOS-4905
clang-tidy integration:
https://issues.apache.org/jira/browse/MESOS-4907

Thanks
Yong

 		 	   		  

Re: Upgrade to clang-format-3.8

Posted by James Peach <jo...@gmail.com>.
> On Mar 17, 2016, at 10:41 AM, Yong Tang <yo...@outlook.com> wrote:
> 
> Hi All
> 
> 
> This email is to announce that the default configuration and the recommended version of the clang-format is being upgraded to 3.8 (from 3.5) in mesos.
> 
> 
> In clang-format-3.8, the newly introduced option "AlignAfterOpenBracket: AlwaysBreak" closes the largest gap between ClangFormat and the style guide in mesos. It avoids  "jaggedness" in function calls and is worth migrating for.
> 
> 
> Along with the changes in clang-format configuration (support/clang-format), the documentation (docs/clang-format.md) is also going to be updated to reflect changes in version and the recommended installation process.
> 
> 
> More details about this upgrade could be found in MESOS-4906 (https://issues.apache.org/jira/browse/MESOS-4906). By the way, thanks Michael for the help on this issue.

This sounds really promising. Is the plan to auto-format everything with clang-format?