<div dir="ltr"><div>astyle would certainly work too.</div><div><br></div>I find clang-format more robust than almost all other formatting tools as Mateusz described.  As for workflow, there are multiple possible routes as to how to go about this.  I personally write pretty messy code when I'm working and then just do a format pass before submitting.  If the editor I'm using supports formatting, great.  However, the command line is super easy.  I also know a number of people who work on code only after applying their own person clang format style to code and then transform back before submitting.  And there is the critical ability to shut off the formatter for sections of code where the formatter will do something seriously wrong... the classic example is matrices in test files. <div><br></div><div>Alternatively, we could easily have astyle as a first pass to add braces before clang-format if someone wanted to implement that.  But there clang-tidy as Mateusz said with:</div><div><br></div><div><a href="https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html">https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html</a><br></div><div><br></div><div>with lots of other check....</div><div><br></div><div><a href="https://clang.llvm.org/extra/clang-tidy/checks/list.html">https://clang.llvm.org/extra/clang-tidy/checks/list.html</a><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 5, 2017 at 4:46 AM, Mateusz Loskot <span dir="ltr"><<a href="mailto:mateusz@loskot.net" target="_blank">mateusz@loskot.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 5 May 2017 at 13:35, Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> wrote:<br>
><br>
> In case we want to have a policy regarding braces around single statements,<br>
> one finding coming from the openjpeg discussion I mentionned :<br>
><br>
> """<br>
> Moreover, concerning braces around single statements, it seems astyle does<br>
> this with the add-braces option:<br>
> <a href="http://astyle.sourceforge.net/astyle.html#_add-braces" rel="noreferrer" target="_blank">http://astyle.sourceforge.net/<wbr>astyle.html#_add-braces</a><br>
> As far as I understood, clang-format does not, and requires another tool<br>
> (clang-tidy) to deal with these cases. So one more point for astyle.<br>
> """<br>
<br>
</span>Rather, it is a separation of concerns: linting vs formatting<br>
AFAIU, clang-format does not modify any code (ie. add tokens).<br>
<br>
I'm not clang-format advocate. I'll repeat myself:<br>
My personal preference is to use clang-format.<br>
I proposed it to GEOS via GEOS RFC.<br>
Kurt found the RFC useful and is using it as a template<br>
to prepare one for GDAL.<br>
IMHO, at the end of the day, tool does not matter as long as proposed<br>
goals are achieved.<br>
<div class="HOEnZb"><div class="h5"><br>
Best regards,<br>
--<br>
Mateusz Loskot, <a href="http://mateusz.loskot.net" rel="noreferrer" target="_blank">http://mateusz.loskot.net</a><br>
______________________________<wbr>_________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/gdal-dev</a></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">--<div><a href="http://schwehr.org" target="_blank">http://schwehr.org</a></div></div>
</div>