<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="">
Hi all,
<div class=""><br class="">
</div>
<div class="">Since we haven’t seen any movement on this in quite a while and our projected merge date is moving ever closer, I wonder if I could summarise the positions that have been given so far so we can decide on a way forward. If I misrepresent what you’ve
stated at all please reply to correct me, I’m just trying to give a brief summary.</div>
<div class=""><br class="">
</div>
<div class="">I opened the discussion with a PR to see what the projected changes would look like; I did this for two reasons, firstly that we were requested to in a discussion about merging on llvm-dev, but also because I believe we should align with the rest
of the community on a single coding style. My position is that I have no preference at all in what the style is, I just think there should be a single one across the community. My reason for thinking this is that <span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">fairly
likely that changes to f18, mlir and llvm will be mixed in together once we land, and working on a single change that has multiple different coding styles within it may lead to some issues for anyone working on those.</span></div>
<div class=""><br class="">
</div>
<div class="">Tim Keith and Peter Klausler from Nvidia replied to say that comment alignment (and code alignment in general) cause spurious changes to a appear when submitting diffs, making it more difficult to see what has changed. Tim Keith also pointed out
that clang and llvm are not properly clang-formatted entirely themselves, which weakens the “common code style across the board” desire.</div>
<div class=""><br class="">
</div>
<div class="">Eric Schweitz replied to show MLIR’s clang-format file, which is also the one used for the lib/Lower subdirectory of f18. This style has only one small change from the LLVM style, but it is nonetheless a diversion. Eric also pointed out that clang-formatting
for new code is enforced on Phabricator by pre-commit bots. This is the case not only for mlir, but for new code heading to clang and llvm too. This is consistent with the Coding Guidelines which do not require that all code is properly clang-formatted, only
all new code. Eric also suggested that we could submit diffs without running clang-format, so that the changes are clear, and then once approved run clang-format to match the code with the rest of the project. This might mitigate the code alignment issues.</div>
<div class=""><br class="">
</div>
<div class="">Johannes Doerfert stated his preference for minimizing clang-format differences from the rest of the project, in part to ease our acceptance by the community. He also stated that he is used to the llvm settings and so anything different makes
his workflow uneasy. I believe this goes hand in hand with my statement about working with different coding styles in a single change.</div>
<div class=""><br class="">
</div>
<div class="">On the F18 community call, Hal Finkel explained the reasoning behind the LLVM coding style decisions. He stated that LLVM prefers readability of code over writability (or reviewability) as code is much more likely to be read than written or reviewed.
This is why LLVM uses code and comment alignment in its coding style. On the call it was also discussed that some people do not find that the alignment makes code easier to read and that this seems to be subjective.</div>
<div class=""><br class="">
</div>
<div class="">I think that this is the point the discussions have reached so far, if I have missed anything or misrepresented anyone’s position please reply to this to clarify.</div>
<div class=""><br class="">
</div>
<div class="">Given the impasse we have got to, I suggest that if we cannot find a compromise here we should take the discussion to llvm-dev and see how the wider community feels about a large diversion from the coding style for a specific sub-project. It may
be that this is not a hard block for merging, however it is something that was requested of us initially so it is something we need to discuss there if we decide not to do it.</div>
<div class=""><br class="">
</div>
<div class="">I hope this helps to move the conversation forward.</div>
<div class=""><br class="">
</div>
<div class="">Thanks</div>
<div class="">David Truby<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 11 Feb 2020, at 10:20, David Truby via flang-dev <<a href="mailto:flang-dev@lists.llvm.org" class="">flang-dev@lists.llvm.org</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi all,
<div class=""><br class="">
</div>
<div class="">We have been having a discussion on the GitHub issue tracker about code formatting (and specifically clang-format settings) and whether to align closer with the rest of the project, which you can find here:
<a href="https://github.com/flang-compiler/f18/pull/945" class="">https://github.com/flang-compiler/f18/pull/945</a>. Since the discussion there hasn’t moved much recently I’d like to start a discussion here so we can get input from a wider group of people. </div>
<div class=""><br class="">
</div>
<div class="">My opinion is that regardless of technical preferences we shouldn’t diverge from the style of the rest of the project as much as we currently do, or at least if we want to do that then we should have a discussion with the wider community about
whether that is acceptable to them.</div>
<div class=""><br class="">
</div>
<div class="">Does anyone else have any input on this?</div>
<div class=""><br class="">
</div>
<div class="">Thanks</div>
<div class="">David Truby</div>
</div>
_______________________________________________<br class="">
flang-dev mailing list<br class="">
<a href="mailto:flang-dev@lists.llvm.org" class="">flang-dev@lists.llvm.org</a><br class="">
https://lists.llvm.org/cgi-bin/mailman/listinfo/flang-dev<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>