<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 5 Dec 2022 at 08:07, Nicklas Larsson via grass-dev <<a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
1. We adapt the formatting policy using ClangFormat.<br></blockquote><div><br></div><div>+1</div><div><br></div><div>I would prefer if formatting changes from GNU indent which can be done separately are done separately. For Python & Black, I did that together but 1) in multiple PRs and 2) we lacked any formatting, so it was a little different. Things like ReflowComments seem like a good second round.  (Sorry, I'm a little confused about your intention with unused .clang-format and what will be in there.)</div><div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

2. We implement "BreakBeforeBraces" rules according the "Stroustrup" style.<br></blockquote><div><br></div><div>Given the lack of unified standard in C and C++, I'm for making choices which bring the formatting closer to Python and Black which Stroustrup seems to do.</div><div><br></div><div><span class="gmail-blob-code-inner gmail-blob-code-marker gmail-js-code-nav-pass"><span class="gmail-pl-c"><span class="gmail-pl-c">Related to that, the in-line comments in the PR are modified to have one space after the code while Black, i.e., our Python code, has two.</span><span class="gmail-pl-c"></span></span></span></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

3. If there are no objections raised within a two weeks period, say until December 18, either to points 1 and/or 2 or even to this proposed deadline, the PR [1] will be merged and work can start on source code formatting.<br></blockquote><div><br></div><div>My approach with Black was to do config+formatting+CI at once which has the disadvantage of adding the commit with config+CI into .git-blame-ignore-revs, but a comment in that file warns about that and it is exactly what will happen when we change the formatting later on with active CI (the formatting will have to go in together with config and CI changes).<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

4. Any changes decided upon ought to be added to <a href="https://trac.osgeo.org/grass/wiki/Submitting/C" rel="noreferrer" target="_blank">https://trac.osgeo.org/grass/wiki/Submitting/C</a><br>
</blockquote><div><br></div><div>Yes. FYI, although details are unclear, the long-term plan for these documents is to move them to code (based on a discussion at a PSC meeting).</div><div><br></div><div>Best,</div><div>Vaclav<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
Cheers,<br>
Nicklas<br>
<br>
<br>
<br>
<br>
<br>
[1] <a href="https://github.com/OSGeo/grass/pull/2272" rel="noreferrer" target="_blank">https://github.com/OSGeo/grass/pull/2272</a><br>
[2] <a href="https://www.gnu.org/software/indent/" rel="noreferrer" target="_blank">https://www.gnu.org/software/indent/</a><br>
[3] <a href="https://clang.llvm.org/docs/ClangFormat.html" rel="noreferrer" target="_blank">https://clang.llvm.org/docs/ClangFormat.html</a><br>
[4] <a href="https://github.com/OSGeo/grass/blob/main/utils/grass_indent.sh" rel="noreferrer" target="_blank">https://github.com/OSGeo/grass/blob/main/utils/grass_indent.sh</a><br>
[5] <a href="https://clang.llvm.org/docs/ClangFormatStyleOptions.html" rel="noreferrer" target="_blank">https://clang.llvm.org/docs/ClangFormatStyleOptions.html</a><br>
[6] <a href="https://github.com/OSGeo/grass/pull/2272/files" rel="noreferrer" target="_blank">https://github.com/OSGeo/grass/pull/2272/files</a><br>
<br>
_______________________________________________<br>
grass-dev mailing list<br>
<a href="mailto:grass-dev@lists.osgeo.org" target="_blank">grass-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/grass-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/grass-dev</a><br>
</blockquote></div></div>