<div dir="ltr">I've tried running pgindent. <div><br></div><div>TLDR: pgindent heavily broken, style ported to clang-format, let's use clang-format with pgindent style.<br><div><br></div><div><a href="https://github.com/postgis/postgis/pull/226" target="_blank">https://github.com/postgis/postgis/pull/226</a> <br><br></div><div> - it arbitrarily uncomments code, <a href="https://github.com/postgis/postgis/pull/226/files#diff-6bc61232f3b565f3dcc84d60ad377e21L14" target="_blank">https://github.com/postgis/postgis/pull/226/files#diff-6bc61232f3b565f3dcc84d60ad377e21L14</a>;<br> - it breaks preformatted comments, <a href="https://github.com/postgis/postgis/pull/226/files#diff-398fded035024e0cd5d922b19ada5c68L443" target="_blank">https://github.com/postgis/postgis/pull/226/files#diff-398fded035024e0cd5d922b19ada5c68L443</a>;<br> - it breaks e-mails in comments, <a href="https://github.com/postgis/postgis/pull/226/files#diff-1ec0062960e90bc800dc321fd582e760L5" target="_blank">https://github.com/postgis/postgis/pull/226/files#diff-1ec0062960e90bc800dc321fd582e760L5</a>;</div><div> - it breaks ascii art in comments, <a href="https://github.com/postgis/postgis/pull/226/files#diff-a8d63a29cc2e89c5928aae29f5a6485eL109" target="_blank">https://github.com/postgis/postgis/pull/226/files#diff-a8d63a29cc2e89c5928aae29f5a6485eL109</a>;<br> - pointer alignment is weird, <a href="https://github.com/postgis/postgis/pull/226/files#diff-cfb8f8761c5379a23860242267edde72R164" target="_blank">https://github.com/postgis/postgis/pull/226/files#diff-cfb8f8761c5379a23860242267edde72R164</a>;</div><div> - it just makes code not compile, <a href="https://travis-ci.org/postgis/postgis/jobs/347246746" target="_blank">https://travis-ci.org/postgis/postgis/jobs/347246746</a> <br> - while formatting, it reports unbalanced parenthesis (which isn't true on svn trunk).<br><br>I suspect that it's possible to write code and comments in subset of C and English compatible with pgindent, but PostGIS isn't this way, it can't be used directly.<br>I didn't prepare a compare pull request, it doesn't make sense to reformat a broken code :)<br><br>Some practices from pgindent and postgres code stylestill can be adopted though even the tool does not fit. I ported Postgres brace style to .clang-format in my PR.</div><div><br></div><div>clang-format that looks like pgindent, checks PRs on travis and formats more than astyle is here:</div><div><a href="https://github.com/postgis/postgis/pull/220/files#diff-86f75d20942198273bc1008963770816">https://github.com/postgis/postgis/pull/220/files#diff-86f75d20942198273bc1008963770816</a> <br></div><div><br></div><div>Let's merge it? :)</div><br><div class="gmail_quote"><div dir="ltr">сб, 24 февр. 2018 г. в 0:16, Sandro Santilli <<a href="mailto:strk@kbt.io" target="_blank">strk@kbt.io</a>>:<br></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, Feb 23, 2018 at 02:51:39PM +0100, Tomas Vondra wrote:<br>
> On 02/23/2018 12:21 PM, Sandro Santilli wrote:<br>
<br>
> > I'm sold, did I hear you volunteering to send a PR for integration<br>
> > of that package in PostGIS ? Or I'll get to that eventually.<br>
><br>
> I can do that, yes. I suggest we do that in two steps:<br>
><br>
> 1) getting the tooling in - essentially copy of src/tools/pgindent with<br>
> changes to paths, exclude patterns, Makefile stuff, etc.<br>
<br>
Done already: check out "pgindent" branch on Gitea or GitLab mirrors.<br>
<br>
> 2) initial run on the code base - I have no idea how noisy this will get<br>
> at this point. It should be done on all supported branches, otherwise<br>
> it'll make back-patching more difficult.<br>
><br>
> I don't think (1) should be committed until there's a clear idea how<br>
> much noise (2) will cause. That is, let's get (1) and (2) ready,<br>
> evaluate the results and then decide if pgindent is the right choice.<br>
<br>
You're welcome to continue from where I left and do (2).<br>
It will get noise, but now we have the astyle and clang-format<br>
branches too for comparing and checking the noise difference.<br>
<br>
--strk;<br>
_______________________________________________<br>
postgis-devel mailing list<br>
<a href="mailto:postgis-devel@lists.osgeo.org" target="_blank">postgis-devel@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-devel" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-devel</a></blockquote></div></div></div>