[postgis-devel] Code formatting digging in

Mateusz Loskot mateusz at loskot.net
Thu Feb 22 11:23:30 PST 2018


On 22 February 2018 at 19:05, Sandro Santilli <strk at kbt.io> wrote:
> What we found was that different versions of `astyle` gave
> different formatting. Can we be sure that clang-format won't
> have the same problem ?

No. It's best to stick to particular version of clang-format [1],
for 100% consistent results.

> As for clang-format:
>   Ubuntu 17.10 has versions 3.8, 3.9, 4.0 and 5.0
>   Debian  8.8  has versions 3.4, 3.5, 3.8
> The fact they ship multiple versions makes me think they
> also behave differently.

Yes, that is the case. And it should be the case for the others ie. astyle too.

> So which do we keep ? And how long
> will our formatting resist before having to mass-change it again ?


Once mass-reformat is done, it may be safe(r) to keep reformatting
only the changesets (git diff -U0)

[1] http://lists.llvm.org/pipermail/cfe-dev/2017-June/054348.html

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net


More information about the postgis-devel mailing list