<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 3 Jul 2018, at 12:13, Tor Arne Vestbø <<a href="mailto:Tor.arne.Vestbo@qt.io" class="">Tor.arne.Vestbo@qt.io</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
On 3 Jul 2018, at 10:26, Lars Knoll <<a href="mailto:lars.knoll@qt.io" class="">lars.knoll@qt.io</a>> wrote:<br class="">
<br class="">
<blockquote type="cite" class="">On 2 Jul 2018, at 16:52, Tor Arne Vestbø <<a href="mailto:Tor.arne.Vestbo@qt.io" class="">Tor.arne.Vestbo@qt.io</a>> wrote:<br class="">
<br class="">
<br class="">
<br class="">
<blockquote type="cite" class="">On 2 Jul 2018, at 16:49, Lars Knoll <<a href="mailto:lars.knoll@qt.io" class="">lars.knoll@qt.io</a>> wrote:<br class="">
<br class="">
<br class="">
<blockquote type="cite" class="">On 2 Jul 2018, at 13:35, Tor Arne Vestbø <<a href="mailto:Tor.arne.Vestbo@qt.io" class="">Tor.arne.Vestbo@qt.io</a>> wrote:<br class="">
<br class="">
<br class="">
<blockquote type="cite" class="">On 2 Jul 2018, at 12:56, Svenn-Arne Dragly <<a href="mailto:svenn-arne.dragly@qt.io" class="">svenn-arne.dragly@qt.io</a>> wrote:<br class="">
<br class="">
There are also many nice options set in the clang-format config found in Qt Creator's sources[2] which I think are interesting. For instance, "BinPackParameters: false" and "BinPackArguments: false" makes sure you to either put all arguments on one line or
 give if arguments will have one line each. This might be in the controversial category, but it is nice to enable while developing. It makes clang-format reflow the code consistently just by moving a single argument to a new line and running clang-format afterwards.<br class="">
</blockquote>
<br class="">
I oppose mandating this style, through clang-format or otherwise.<br class="">
</blockquote>
<br class="">
Having a common style that we start following is worth something. And yes, everybody will always find some details he won't like. So we won't get anywhere if everybody wants it exactly his way.<span class="Apple-converted-space"> </span><br class="">
</blockquote>
<br class="">
Why not ease into this with the non-controversial style-rules first?<span class="Apple-converted-space"> </span><br class="">
</blockquote>
<br class="">
clang-format will produce one way how the output is formatted. It will reformat your sources a certain way with less definitions in the file as well. So it's most likely better to have more rules defined as it'll give something closer to our implicitly used
 coding style.<br class="">
</blockquote>
<br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Really??
 That sounds like a key feature, I’m surprised clang-format doesn’t allow it to leave code untouched.<span class="Apple-converted-space"> </span></span></div>
</blockquote>
<blockquote type="cite" class="">
<div class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">If
 that’s the case then I’m not convinced this exercise is worth the churn. I thought we were going to run it as a fancy style bot, complaining if the code isn’t per the format-file, but allowing us to ignore it if we feel the tailored code-formatting is better?
 Doesn’t this mean the bot will complain a lot?<span class="Apple-converted-space"> </span></span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
</div>
</blockquote>
<div><br class="">
</div>
The idea is to only run it on lines that the change touches anyway. That is apparently possible, so you will not get a full reformat of the file(s) you touched.<br class="">
<blockquote type="cite" class="">
<div class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">We
 already have a style guide. Introducing clang-format to the mix does two things:<span class="Apple-converted-space"> </span></span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""> 1.
 Formalizes the style guide (to a certain degree)</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""> 2.
 Introduces new style rules</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">The
 second point was new to me, I was under the impression we were only going to use it as a convenient tool to improve #1.</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
</div>
</blockquote>
<div><br class="">
</div>
</div>
It does formalise the rules, something I think is a good thing. To some extent it might introduce new ones, but the idea was to aim for a format file that is very close to our existing rules.
<div class=""><br class="">
</div>
<div class="">Cheers,</div>
<div class="">Lars</div>
<div class=""><br class="">
</div>
</body>
</html>