<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 7 Dec 2022, at 02:51, Vaclav Petras <<a href="mailto:wenzeslaus@gmail.com" class="">wenzeslaus@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div dir="ltr" class=""><br class=""></div><br class=""><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" class="">grass-dev@lists.osgeo.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br class="">
1. We adapt the formatting policy using ClangFormat.<br class=""></blockquote><div class=""><br class=""></div><div class="">+1</div><div class=""><br class=""></div><div class="">I would prefer if formatting changes from GNU indent which can be done separately are done separately.</div></div></div></div></blockquote><div><br class=""></div><div>I don’t quite follow you.</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_quote"><div class="">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></blockquote><div><br class=""></div><div><br class=""></div><div>My intention is simple. First agree on style and add the .clang-format file to source and only after that start the actual formatting work.</div><div><br class=""></div><div>I strongly advice to make visual supervision on formatting changes before merging. For that reason alone the whole source base should be formatted in batches of about 500 files each to be manageable. In total there are ca. 3360 files. The directories ‘include’ and ‘lib’ may need special attention because of the Doxygen comments, all the other will be very easily processed. In all this will need some 5-8 PRs.</div><div><br class=""></div><div><br class=""></div><div>Directory     #files</div><div><div>____________________</div><div>lib             1199</div><div>include          103</div><div>db               120</div><div>display          109</div><div>general           67</div><div>imagery          379</div><div>misc              13</div><div>ps                84</div><div>raster           774</div><div>raster3d         100</div><div>temporal           1</div><div>utils              2</div><div>vector           408</div><div>visualization      2</div><div>====================</div><div>                3361</div><div class=""><br class=""></div></div><div>I’d say we should strive to limit the formatting changes of a single file to minimum, i.e. to 1 (as in one) time. Therefore any changes like ReflowComments should be done in one go. (Also, I’m happy to go through all those file once, but not twice.)</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div dir="ltr" class=""><div class="gmail_quote"><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 class=""></blockquote><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><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></span></div></div></div></blockquote><div><br class=""></div><div>Well, the two are distinct different languages with different history. Black also imposes 88 col line width, not 80. I’d say we keep the ClangFormat defaults as long as there is no strong argument against. In the case with SpacesBeforeTrailingComments set to 1: do not forget that C-style comments take at least 6 characters!  E.g. `/* comment */`. And that is not even a Doxygen doc comment.</div><div><br class=""></div></div><br class=""></body></html>