Getting Style

David Nolden david.nolden.kdevelop at art-master.de
Fri Apr 20 20:20:48 UTC 2012


Am 20. April 2012 21:44 schrieb Andreas Pakulat <apaku at gmx.de>:
> On 20.04.12 19:29:31, Milian Wolff wrote:
>> Hey all,
>>
>> I want to make our code base better readable and use a consistent style for
>> *all* our codebase, including external plugins, cmake support, cpp parser,
>> etc. pp.
>>
>> We discussed this previously, but quite frankly I forgot the outcome. But
>> before we start the trollwar on tabs vs spaces, some important notes:
>>
>> # blame without space commits
>>
>> I found out that one can use "git blame -w" to annotate a file but ignoring
>> whitespace changes, which is very helpful. This of course won't help with
>> other style changes like adding braces, fixing typos and such, but still this
>> is a very big improvement. Imo we should even make this the default when using
>> "annotate file" in kdevelop.
>
> Does this handle whitespace anywhere in the line? (it probably does, but
> the manpage is not very extensive on this)
>
>> # now, what style?
>>
>> So, I hope you agree that with the above, a run over *all* our code bases with
>> uncrustify would be feasable and very useful.
>
> FWIW: I disagree that such a "reformat all sources" has any real value.
> If there are pieces of code which are hard to understand/unreadable,
> thats ok to reformat in my opinion. I don't think we have many of such
> cases though. The only reason I could see to do this might be if you
> notice that the formatting makes contributing much harder.
>
> That being said, even though I disagree that this is very useful I'm not
> objecting doing this mass-reformatting.

The main benefit of reformatting, to me, is making it easier to write
consistently formatted code in different parts of KDevelop. With
correct format_sources rules in place, KDevelop would use the correct
indentation settings wherever I am, and I could fixup my code to be
formatted perfectly using a single keystroke.

Greetings, David




More information about the KDevelop-devel mailing list