[MERGE] remove has_key() usage
John Arbash Meinel
john at arbash-meinel.com
Thu Aug 31 14:49:48 BST 2006
Matthieu Moy wrote:
> John Arbash Meinel <john at arbash-meinel.com> writes:
>
>> So no, it isn't a critical fix. But I think it is a little unhygenic to
>> have trailing whitespace. And when you set your editor to help you avoid
>> it, suddenly you see how bad it really is.
>
> I don't like trailing whitespace either. I like the code to be in a
> kind of "canonical form", that is, given what I see on the screen,
> there's only one way to write it.
>
> But the problem if you start _removing_ trailing whitespaces from code
> written by others is that it breaks merge and diff. So, if you decide
> to remove trailing whitespaces, you should make sure that no one
> introduce them anymore, with a kind of testcase (not really a testcase
> because it does not "test" bzr, but it should prevent pqm from
> commiting).
>
Actually, we already have a 'bzrlib/tests/test_api.py' file, which was
used to ensure that we weren't creating WorkingTree objects inside
Branch (WT should know about a B but not really the other way).
It would be reasonable to write another one that goes through and uses a
regex like r"\s+$"
That is what I use in Vim to find any extra ones that I've left around.
So I agree, it would be reasonable that if we go through and remove
trailing whitespace, we should add a test that ensures our codebase
doesn't have any.
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060831/d35a54b4/attachment.pgp
More information about the bazaar
mailing list