[postgis-devel] Code formatting digging in

Sandro Santilli strk at kbt.io
Thu Feb 22 10:05:14 PST 2018


On Thu, Feb 22, 2018 at 05:59:25PM +0100, Raúl Marín Rodríguez wrote:

> a .clang-format file with the accepted style in the project to use it
> locally
> (as a precommit check).

We tried a similar path in the past, see `make astyle`.
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 ?

Running that style command (disabling the version check) right
now on the codebase results in:
 195 files changed, 40436 insertions(+), 35097 deletions(-)

QGIS (to look at close neighbours) used to ship their own version
of astyle to deal with it. Recently they introduced again ability
to use the system astyle, do we want to try that again ?
https://github.com/qgis/qgis/commit/c48e0069aee5360f71d3128a1f3c14775b7fb491

QGIS now requires astyle 3.0+
Ubuntu 17.10 (released on October 2017) ships astyle 2.06
Debian GNU/Linux 8.8 (jessie) as version 2.04

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. So which do we keep ? And how long
will our formatting resist before having to mass-change it
again ?


--strk;


More information about the postgis-devel mailing list