tabcleaner.py is a utility that reformats leading whitespace in a Python
source. It uses tokenize.py (from the std distribution) to detect INDENTs
and DEDENTs, then reformats according to the user's options (tabs-only,
spaces-only with indent size n, or mixed with tab worth m and indent level
of n).
Python does not care about the indent of comments and multi-line strings.
tabcleaner places these at what Python considers the current indent level.
About half the time, this is correct; the rest of the time it is probably
one indent level less than what was desired. It is pretty much guaranteed
to be syntactically correct, (earlier versions broke on some triple-quoted
strings).
With no args, (or "-h") prints usage text.
Contact:
[email protected]