how to "normalize" indentation sources
ask at me
Thu May 25 04:42:37 CEST 2006
John Machin wrote:
> On 25/05/2006 12:00 PM, AndyL wrote:
>> I have a lot of sources with mixed indentation typically 2 or 4 or 8
>> spaces. Is there any way to automatically convert them in let's say 4
> Yup. Right under your nose:
> C:\junk>\python24\tools\scripts\reindent.py --help
> reindent [-d][-r][-v] [ path ... ]
> -d (--dryrun) Dry run. Analyze, but don't make any changes to, files.
> -r (--recurse) Recurse. Search for all .py files in subdirectories too.
> -v (--verbose) Verbose. Print informative msgs; else no output.
> -h (--help) Help. Print this usage information and exit.
> Change Python (.py) files to use 4-space indents and no hard tab
> Also trim excess spaces and tabs from ends of lines, and remove empty lines
> at the end of files. Also ensure the last line ends with a newline.
thx a lot, A.
More information about the Python-list