tabs and spaces in source
Vlad Skvortsov
vss at 73rus.com
Tue Dec 12 12:38:53 PST 2006
Oleg G. Sharov wrote:
>> I've found that a lot of code use the both methods for indentation:
>> tabs and spaces. Take a look at DITrack/DB.py for example.
>> I use vim and "set tabstop=4", so all code become incorrect.
>>
>
>
>> Vlad, Oleg, your comments?
>> What style do you prefer?
>>
The style accepted after 0.4 is no tabs, 4 spaces as indentation.
>
>
>> My opinion: 4 spaces for one level of indentation, no tabs.
>> Every file should be "retabed".
>>
Basically we convert files to new "tabbing" as soon as we need to modify
something inside. But retabbing should go in two different commits: the
first to replace tabs with spaces, the second to change indentation
width. Be sure to set "expandtab" and set "tabstop" to 8 before the
first step.
Obviously, if you see a wrong mix of tabs and spaces in a file that has
been actively worked on (such as DB.py), it indicates a mistake.
>
> We use 4 spaces instead of tabs. You can add to your .vimrc string
> "autocmd FileType python setlocal sw=4 sts=4" into block
>
Yep, this is what I use.
--
Vlad Skvortsov, vss at 73rus.com, http://vss.73rus.com
More information about the Dev
mailing list