Re: [gdal-dev] SortIncludes was Re: Motion: adopt RFC69 C/C++ Code Formatting

2022-11-24 Thread Javier Jimenez Shaw
clang-format keeps the blocks independent, yes. We usually divide in three (or more) blocks: internal headers, third party, std. But it is a matter of taste, of course. This is the example of a file that uses gdal: #pragma once #include "CommandOptions.h" #include #include #include #include

Re: [gdal-dev] SortIncludes was Re: Motion: adopt RFC69 C/C++ Code Formatting

2022-11-24 Thread Andrew C Aitchison
On Thu, 24 Nov 2022, Javier Jimenez Shaw wrote: 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. It turns out that although 'man md5' says: #include #include the header file

Re: [gdal-dev] SortIncludes was Re: Motion: adopt RFC69 C/C++ Code Formatting

2022-11-24 Thread Even Rouault
I'm pretty sure that in the past I've fought against issues related to include orders, at least on some platforms, and some things were beyond our control (system headers or dependency headers), so I think it is best to exclude it for now as Alessandro just did for something that is intended

Re: [gdal-dev] SortIncludes was Re: Motion: adopt RFC69 C/C++ Code Formatting

2022-11-24 Thread Javier Jimenez Shaw
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. 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

Re: [gdal-dev] SortIncludes was Re: Motion: adopt RFC69 C/C++ Code Formatting

2022-11-24 Thread ElPaso
Il 24/11/22 10:55, Andrew C Aitchison ha scritto: On Thu, 24 Nov 2022, ElPaso wrote: Hi, Motion: Adopt RFC88: RFC69 C/C++ Code Formatting [1] I have updated the RFC [1] to use pre-commit and I have created a draft implementation of the pre-commit hook and the CI integration with a GH

[gdal-dev] SortIncludes was Re: Motion: adopt RFC69 C/C++ Code Formatting

2022-11-24 Thread Andrew C Aitchison
On Thu, 24 Nov 2022, ElPaso wrote: Hi, Motion: Adopt RFC88: RFC69 C/C++ Code Formatting [1] I have updated the RFC [1] to use pre-commit and I have created a draft implementation of the pre-commit hook and the CI integration with a GH workflow [2]. If adopted, we still have to agree on