[GRASS-dev] Python indentation?

Glynn Clements glynn at gclements.plus.com
Wed Sep 21 00:20:30 EDT 2011


Markus Neteler wrote:

> using python's
>        -t     Issue a warning when a source file mixes tabs and spaces
> for indentation in a way
>               that makes it depend on the worth of a tab expressed in
> spaces.  Issue  an  error
>               when the option is given twice.
> 
> I get some warnings in the GRASS code:

> Would it make sense to re-indent the code with:
> tools/reindent.py ? Or do we need to modify that first (how)

I'm not sure there's much point, as it will keep getting out of sync. 
Emacs' python-mode disables the used of tabs by default, but clearly
other editors don't.

If anything, I'd suggest using reindent.py to fix the formatting, then
reinstating the tabs. Hopefully, this will make it clear to anyone who
tries to view or edit the code using 4-column tabs that they shouldn't
be doing that. Python uses 8-column tabs, and this isn't something you
can change in a text editor.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list