<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Johannes,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The header exception we are referring to is the IncludeCategories: section in the clang-format file. The default LLVM style has (llvm|llvm-c|clang|clang-c) as prefixes for headers to ensure those headers appear first when includes are sorted. This follows the
 Coding Style which says that LLVM sub-project includes should be sorted from most specific to least specific.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
As a small example: if we don't add this specific excpetion and I write</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
#include <flang/parser/parse-tree.h></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
#include <clang/Driver/Driver.h></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
this will be re-sorted to <br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt">
#include <clang/Driver/Driver.h></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt">
#include <flang/parser/parse-tree.h></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt">
as clang is higher in the priority order than flang without an additional exception.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt">
Given that the order should be different for each sub-project (as their own headers should be first) I think this one addition to the clang-format file does make sense, rather than having it in the global style.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt">
I hope that explanation helps!<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt">
Thanks</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt">
David Truby<br>
</div>
<br>
</div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Doerfert, Johannes <jdoerfert@anl.gov><br>
<b>Sent:</b> 11 February 2020 14:05<br>
<b>To:</b> flang-dev@lists.llvm.org <flang-dev@lists.llvm.org>; David Truby <David.Truby@arm.com><br>
<b>Subject:</b> Re: Code formatting alignment with LLVM</font>
<div> </div>
</div>
<div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
I'm always in favor of minimizing the differences. It helps getting "accepted" by the community but also me personally. I'm used to llvm settings, anything that differs looks weird and will make my workflow uneasy. I think a lot is just conditioning, when I
 read diffs, for example, the color highlighting is usually good enough to show the non-alignment change even if things moved a bit. I don't notice that as a problem by now, which is not to say I don't understand the arguments made for the current f18 settings.<br>
<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
Btw. I failed to find the clang format "clang header exception" mentioned in the call yesterday. Can someone show me a minimal example to show the effect? I mean, what does clang do differently for which we need an extra option? It sounds like something that
 needs fixing and we might be able to sign with llvm without changing the current options.<br>
<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
Cheers,<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
  Johannes<br>
<br>
<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
P.s. I strongly advice to have discussions on the list or on phabricator, whichever is applicable. We already know various ppl do not monitor/interact with GH.<br>
<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
<span id="x_OutlookSignature">
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
--<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
written from my phone</div>
</span><br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> flang-dev <flang-dev-bounces@lists.llvm.org> on behalf of David Truby via flang-dev <flang-dev@lists.llvm.org><br>
<b>Sent:</b> Tuesday, February 11, 2020 4:20:57 AM<br>
<b>To:</b> flang-dev@lists.llvm.org <flang-dev@lists.llvm.org><br>
<b>Subject:</b> [flang-dev] Code formatting alignment with LLVM</font>
<div> </div>
</div>
<div class="" style="word-wrap:break-word; line-break:after-white-space">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>
</div>
</body>
</html>