Let's end the formatting mess

Aleix Pol aleixpol at kde.org
Wed Nov 9 16:40:58 UTC 2011

On Wed, Nov 9, 2011 at 5:24 PM, David Nolden <
david.nolden.kdevelop at art-master.de> wrote:

> 2011/11/9 Andreas Pakulat <apaku at gmx.de>:
> >> Thank you, but I prefer my pretty 4-space indentation in the code
> >> that I wrote.
> >
> > Great bike-shedding topic. I agree with Alex on the 4-spaces thing,
> > especially since horizontal space is cheap these days.
> Well, some people like to use the increased resources available these
> days for useful things, for example for split-views or tiled windows,
> instead of wasting it for whitespace.

Problems of code width are not solved by removing the indentation spaces
but by enforcing to limit the code to 80 columns, or 100. I don't split
views myself, so I'm not sure anything on that regard.

> > IMHO the codebase actually is quite well formatted in general. Things
> It's not terrible, but it's also not good. I can point you at tons of
> files which even have 4-space and 2-space indentation mixed. I agree
> that it's not such a huge problem for reading, but it's very annoying
> when writing small portions of code in many different places, each
> with a different kind of formatting which I must adapt to. Therefore,
> we should at least have a way to automatically format newly inserted
> code. Uncrustify is perfect for this, because it can largely
> "normalize" the code. We simply have to define which formatting
> configurations we want to use for what portions of our code, and then
> define a rule that every committer must format the code before
> committing it.

> It's also annoying to always tell new contributors to remove training
> whitespaces, add/remove whitespace here and there, or whatever. In
> future we can simply tell them "run the formatting script before
> before creating the patch", or simply do it by ourselves.
Meh, I don't think trailing spaces are that much of a problem... It's
mostly that reviewboard displays them in red neon lights.

> In general, a human shouldn't be forced to do something which a
> machine can do better (eg. format the code in a consistent exactly
> defined way depending on the current context). Of course we can define
> different formattings for different parts of the codebase, although
> one consistent formatting would be better.

If we can't even have everyone on board regarding the indentation, I'm not
sure how can we agree on a whole coding style for the whole kdev*.

> Greetings, David
> --
> KDevelop-devel mailing list
> KDevelop-devel at kdevelop.org
> https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20111109/c87c7489/attachment.html>

More information about the KDevelop-devel mailing list