[Python-Dev] reindenting

Antoine Pitrou solipsis at pitrou.net
Wed May 5 00:02:06 CEST 2010


Le Tue, 04 May 2010 11:27:58 -0400, Zvezdan Petkovic a écrit :
> 
> A simple replacement of a tab with 4 spaces as you propose does not work
>  on such a code.

Right, I was simplifying a bit.

I've just written a script which does a slightly more elaborate 
reindentation of C files, but still with the main objective of replacing 
tabs with 4-spaces indents. It shows good results on most of the source 
tree. In particular, it handles continuation lines and keeps vertical 
alignment correct in the majority of cases. This script could probably be 
applied with little a posteriori manual intervention.

It can be found in trunk/sandbox/untabify/untabify.py.

Regards

Antoine.



More information about the Python-Dev mailing list