[Insight-developers] KWStyle not run when adding a file in git?

Matthew McCormick (thewtex) matt at mmmccormick.com
Tue Oct 26 13:37:04 EDT 2010


2010/10/25 Gaëtan Lehmann <gaetan.lehmann at jouy.inra.fr>:
>
> Le 25 oct. 10 à 04:20, Matthew McCormick (thewtex) a écrit :
>
>> Hi Gaetan,
>>
>>>> Hi,
>>>>
>>>> I had to fix a set of new files because of missing copyright headers
>>>> today.
>>>> When I tried to commit my changes, KWStyle blocked me because of some
>>>> non
>>>> aligned typedefs and things of that kind.
>>>> Shouldn't they have been detected first when I have added them in the
>>>> repository?
>>>>
>>
>> Thanks for reporting this and your supposition is correct.  However, I
>> cannot reproduce this behavior.  Can you please try again and send a
>> problem file along with its path in its tree.
>>
>
> If you look in my patch "pad by 1 by default in
> ObjectByObjectLabelMapFilter", 619bf1ae54af37cdf314884bce46bbd0477ef6a4, you
> can see that the Self typedef was misaligned in
> Code/Review/itkObjectByObjectLabelMapFilter.h. The alignment has been fixed
> in that patch, but should have been detected earlier, during the addition of
> the file in git.
>

Here is what I did, but it detects the bug in the first commit.  Maybe
you had the hook temporarily turned off?

# 1be4306997^ is the commit before the initial file add.
git checkout -b add_file_test 1be4306997d8c79d6221aa52d1e24c6e6f7827bf^
git checkout 1be4306997d8c79d6221aa52d1e24c6e6f7827bf --
Code/Review/itkObjectByObjectLabelMapFilter.h
git add Code/Review/itkObjectByObjectLabelMapFilter.h
git commit

And I get the following

Error #16 (79) Type definition (Superclass) is not aligned with the previous
one: 53 v.s. 56
Error #16 (80) Type definition (Pointer) is not aligned with the previous one:
53 v.s. 56
Error #16 (81) Type definition (ConstPointer) is not aligned with the previous
one: 53 v.s. 56


pre-commit hook failure
-----------------------

KWStyle check failed.

Line numbers in the errors shown refer to the file:
Code/Review/itkObjectByObjectLabelMapFilter.h.kws


More information about the Insight-developers mailing list