<div dir="auto">In my opinion if the order of the includes affects the output there is something wrong in the code. I hope md5 is not recommending the order.<div dir="auto"><br></div><div dir="auto">I find the ordering feature very useful as a way to detect those errors (not definitive because it is not testing every combination, but a fixed criterion is good).<br><div dir="auto"><br></div><div dir="auto">In case you insist on keeping the order defined by the user (more for aesthetic reasons usually) you can just add a newline to separate the includes in blocks. Clang-format keeps the contiguous blocks independent.</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 24 Nov 2022, 11:21 ElPaso, <<a href="mailto:elpaso@itopen.it">elpaso@itopen.it</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Il 24/11/22 10:55, Andrew C Aitchison ha scritto:<br>
> On Thu, 24 Nov 2022, ElPaso wrote:<br>
><br>
>> Hi,<br>
>><br>
>> Motion:<br>
>><br>
>> Adopt RFC88: RFC69 C/C++ Code Formatting [1]<br>
>><br>
>> I have updated the RFC [1] to use pre-commit and I have created a <br>
>> draft implementation of the pre-commit hook and the CI integration <br>
>> with a GH workflow [2].<br>
>><br>
>> If adopted, we still have to agree on which coding style to apply <br>
>> (for now I used a clang-format file I've found under gdal/scripts), <br>
>> but the biggest decision is wether proceed with an initial "Big <br>
>> Reformat" or an incremental one, my draft implementation supports both.<br>
>><br>
>> Kind regards.<br>
>><br>
>> [1] <br>
>> <a href="https://github.com/elpaso/gdal/blob/rfc69_cplusplus_formatting-text-only/doc/source/development/rfc/rfc69_cplusplus_formatting.rst" rel="noreferrer noreferrer" target="_blank">https://github.com/elpaso/gdal/blob/rfc69_cplusplus_formatting-text-only/doc/source/development/rfc/rfc69_cplusplus_formatting.rst</a><br>
>> [2] <br>
>> <a href="https://github.com/elpaso/gdal/tree/rfc69_cplusplus_formatting_revival" rel="noreferrer noreferrer" target="_blank">https://github.com/elpaso/gdal/tree/rfc69_cplusplus_formatting_revival</a><br>
><br>
> I have just tried this on my driver code and am concerned that the<br>
> default sets --sort-includes.<br>
<br>
[...]<br>
<br>
<br>
> So without tweaking, clang-format is potentially breaking my code.<br>
> I fear that we need a project .clang-formats file with atleast<br>
> SortIncludes: false<br>
><br>
<br>
Good point, added: <br>
<a href="https://github.com/elpaso/gdal/commit/c54d54d209ce28c2017b3ebb0bcc1d23c5472693" rel="noreferrer noreferrer" target="_blank">https://github.com/elpaso/gdal/commit/c54d54d209ce28c2017b3ebb0bcc1d23c5472693</a><br>
<br>
<br>
-- <br>
Alessandro Pasotti<br>
w3: <a href="http://www.itopen.it" rel="noreferrer noreferrer" target="_blank">www.itopen.it</a><br>
<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank" rel="noreferrer">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div>