← Back to team overview

mugle-dev team mailing list archive

Mixing tabs and spaces

 

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:

   1. Convert the entire codebase to spaces.
   2. Require everybody install the bzr-text-checker
plugin<https://launchpad.net/bzr-text-checker>
   .
   3. 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?

Attachment: rules
Description: Binary data


Follow ups