[vtk-developers] code formatting prior to merge request

David Gobbi david.gobbi at gmail.com
Thu Aug 6 14:33:54 EDT 2015


Hi Chaffra,

When you edit a file, the most important thing is keep the style the same
as it was before.  This means that any code-styling tool like astyle or
kwstyle that operates on the entire file will cause problems.  You should
only apply styling to the blocks of code that you, yourself, have added to
the files. That makes git happy, because it can properly track all of the
changes and attribute each block of code to the correct person.

Also, the code must not have any hard tabs or invisible whitespace (extra
spaces at the ends of lines, or extra blank lines at the end of files).
The reason for this is that any changes to the code must be visible
changes.  Changing spaces to tabs or vice-versa is an invisible change, so
tabs are not allowed.

 - David


On Wed, Aug 5, 2015 at 3:00 PM, David E DeMarle <dave.demarle at kitware.com>
wrote:

> Please reply all to keep the list in on the discussion, thanks.
>
> I've never used either pretty-printer so I can't comment on their merits.
>
>
>
> David E DeMarle
> Kitware, Inc.
> R&D Engineer
> 21 Corporate Drive
> Clifton Park, NY 12065-8662
> Phone: 518-881-4909
>
> On Wed, Aug 5, 2015 at 4:57 PM, Chaffra Affouda <chaffra at gmail.com> wrote:
>
>> Thanks  David,
>>
>> Is the more general way to use KWStyle or Astyle?
>>
>>
>>
>>
>> On 08/05/2015 04:28 PM, David E DeMarle wrote:
>>
>> I've used this a bit with eclipse and it prevents most of the pedantic
>> problems.
>>
>> I'm not an eclipse guru so I can't tell you how to apply it after the
>> fact off the top of my head.
>>
>> hth
>>
>> David E DeMarle
>> Kitware, Inc.
>> R&D Engineer
>> 21 Corporate Drive
>> Clifton Park, NY 12065-8662
>> Phone: 518-881-4909
>>
>> On Wed, Aug 5, 2015 at 4:13 PM, Chaffra Affouda <chaffra at gmail.com>
>> wrote:
>>
>>> Hi,
>>>
>>> What's the best way to format the code prior to a merge request? I am
>>> using eclipse to format the code but the kwrobot keeps rejecting the basic
>>> content.
>>>
>>> Thanks,
>>> Chaffra
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20150806/c9c7a2f0/attachment.html>


More information about the vtk-developers mailing list