[postgis-devel] Code formatting digging in

Vicky Vergara vicky at georepublic.de
Tue Mar 6 07:55:07 PST 2018


My 2 cents:

I don't like automatic formatters they are "code invasive".

What I use is cpplint, and its configurable, which does not format the
code, it only indicates where a formating style is not followed.
Its coded in python, some not all of the google code C++ style guide is
followed.

So, how I worked during the pgRouting rewrite (once I decided to use it)
was:
use cpplint on the new or modified files.
No bug to fix, leave the file in peace.
No additional code to add, leave the file in peace.

Reading the C code of postGIS, (even that are huge files) its very nice.
Interesting would be if based on what is there, you configure cpplint to
have to make the least amount of changes on your code.

[1]
https://github.com/pgRouting/pgrouting/blob/master/tools/scripts/code_checker.sh
[2] https://google.github.io/styleguide/cppguide.html















On Mon, Mar 5, 2018 at 10:19 AM, Sandro Santilli <strk at kbt.io> wrote:

> On Sat, Mar 03, 2018 at 01:50:51PM -0500, Regina Obe wrote:
>
> > From my perspective, the 3 most important things about consistent
> convention are:
> >
> > 1) Tab or Space for indenting (and if space how many spaces)
> > 2) LF or CRLF for line end
> > 3) character set (this has bitten us in the past with people editing the
> NEWS file and changing the encoding to Latin or something and screwing up
> people's names)
>
> I agree, and I think editorconfig is doing all of the above.
>
> For the record, I also saw the editorconfig plugin for Vim
> strip trailing blanks from untouched lines. It is the main
> reason why you find some "strip trailing slashes" commits from
> myself in the relatively recenty codechange history.
> I do not remember it changing indentation from non-touched lines).
>
> --strk;
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-devel
>



-- 

Georepublic UG (haftungsbeschränkt)
Salzmannstraße 44,
81739 München, Germany

Vicky Vergara
Operations Research

eMail: vicky at georepublic.de
Web: https://georepublic.info

Tel: +49 (089) 4161 7698-1
Fax: +49 (089) 4161 7698-9

Commercial register: Amtsgericht München, HRB 181428
CEO: Daniel Kastl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20180306/b4d1624f/attachment.html>


More information about the postgis-devel mailing list