← Back to team overview

mugle-dev team mailing list archive

Re: Mixing tabs and spaces

 

My code is one line, don't worry about it. Do you have instructions on how to set this up in eclipse?



On 20/05/2011, at 3:59 PM, Matt Giuca <matt.giuca@xxxxxxxxx> wrote:

Guys, I know it is late in the game, but if I am going to be working on this project over the weekend I am going to go nuts dealing with this.

I don't mind working with tabs (I prefer spaces), but I cannot work with a code base that has every third line it changes between tabs and spaces. My editor (vim) is going nuts trying to keep up, and good luck reading commit logs and diffs (where the indentation is bouncing around in and out).

What editors are you guys using such that this is going on? I assume you are using Eclipse. Can you set it to only write spaces, and have it automatically convert tabs to spaces? I think (at least one of you) has it set (possibly by default) to automatically convert tabs to spaces, but to indent using tabs, or vice versa.

Would anybody mind if I did this, at this late stage:
Convert the entire codebase to spaces.
Require everybody install the bzr-text-checker plugin.
Provide a bzr-text-checker rules file (attached).
This will mean that Bazaar will refuse to commit if you commit any changes with:
Tabs
Trailing whitespace (whitespace after the last non-whitespace character on a line)
No newline at the end of a file
Windows newlines
And it will warn you if you commit lines that are too long (but you can turn this off if it bothers you as it doesn't bother me too much).

Therefore, you'll have to set Eclipse to behave and not insert any more tabs, and if it does you'll be told about it.

If this is too much hassle, I won't do it, but ... I would really like to. I will handle the converting of the codebase, so you don't need to worry. I can wait until tonight when Scott has committed his code, to make sure it doesn't happen when you guys have uncommitted code, and then you'll just update and everything will be clean. But there's no point in cleaning up the codebase without also enforcing the above rules.

What do you think?
<rules>
--
Mailing list: https://launchpad.net/~mugle-dev
Post to     : mugle-dev@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~mugle-dev
More help   : https://help.launchpad.net/ListHelp

Follow ups

References