Terry J. Reedy <tjre...@udel.edu> added the comment:

reindent.py does the following:

1. Change Python (.py) files to use 4-space indents and no hard tab characters. 
 IDLE editor does this by default, as do other programming editors, except as 
PEP8 recommends something else for continuation lines within fences <(), [], 
{}>.  Before doing anything with reindent, I would want to check whether it 
messes with IDLE;s smart indents.

The format module and Format menu has functions to add/remove tabs and changes 
space indents, as well as rewrap.

The only thing left is dealing with a messed up file, but suspect that this is 
rarer than 19 (1st public version of reindent.py) or even 10 years ago (this 
issue).  Is this issue still needed?

2. Trim excess spaces and tabs from ends of lines.  Format => strip whitespace, 
added on this issue, does this. (The code is now in the format module.)

3. Remove empty lines at the end of files.  Rstrip should do this but does not. 
 This is a separate issue from reindenting.

4. Ensure that the last line ends with a newline.  Save in iomenu ensures this, 
but this should be part of 'strip whitespace', especially if we 'rstrip' on 
save (#33046).

----------
nosy: +taleinat

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue5150>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to