[issue5150] IDLE to support reindent.py

2019-11-17 Thread Terry J. Reedy


Terry J. Reedy  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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5150] IDLE to support reindent.py

2016-06-03 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Having occasionally forgotten, and had to do whitespace commits, I agree.  For 
Python code, there is never an absolute need for trailing whitespace.  Trailing 
whitespace in string literals can be done by parse time concatenation.
'''\
line 1
line 2
''' 'line with trailig space'
Indeed, the trick is needed to mark the trailing space in the code.

I have thought about removing trailing spaces after each return, but pasting 
may be a problem.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5150] IDLE to support reindent.py

2016-02-13 Thread irdb

Changes by irdb :


--
nosy: +irdb

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5150] IDLE to support reindent.py

2016-02-13 Thread Raymond Hettinger

Raymond Hettinger added the comment:

One other thought, it would be nice if there were an option (on by default) to 
automatically strip trailing whitespace when a file is saved.  That would be 
much nicer than making the user remember to do periodic clean-ups as they edit.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5150] IDLE to support reindent.py

2014-04-17 Thread Ned Deily

Ned Deily added the comment:

The code needs to be updated for Python 3 and it needs a test.  I'm deassigning 
it in the hopes that someone will feel free to pick it up.

--
assignee: ned.deily - 
stage: commit review - patch review
versions: +Python 3.5 -Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5150
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5150] IDLE to support reindent.py

2014-04-17 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I use rstrip routinely when editing idlelib files, before committing, so it has 
been useful for that purpose.

I do not happen to know what reindent.py does that the current format options 
do not.

#18704 was about integrating the pep8 style checker. That was closed in favor 
of adding a generic facility to run external analysis tools. There is not an 
open issue for that yet, but I expect it to happen, perhaps this summer. 
Reindent.py, if maybe improved, might be a candidate, though I will also try to 
look at the patch sometime.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5150
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5150] IDLE to support reindent.py

2012-03-25 Thread Andrew Svetlov

Changes by Andrew Svetlov andrew.svet...@gmail.com:


--
nosy: +asvetlov

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5150
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5150] IDLE to support reindent.py

2010-11-28 Thread Raymond Hettinger

Changes by Raymond Hettinger rhettin...@users.sourceforge.net:


--
assignee: rhettinger - ned.deily
nosy: +ned.deily

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5150
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5150] IDLE to support reindent.py

2010-11-21 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

Opened back up for the new patch (posted after the previous close).

--
status: closed - open

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5150
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5150] IDLE to support reindent.py

2010-10-15 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

reindent.py is very much a script: It lacks a nice, full programmatic API, I 
mean standalone functions to check a file object or a filename and functions 
implementing the command-line interface.  As it is now, you see for example 
print calls in the middle of functions, so it’s not usable as a module.

Maybe bring this to python-dev or -ideas?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5150
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5150] IDLE to support reindent.py

2010-10-15 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

There's no need to go to python-dev or python-ideas with this one.  If someone 
wants to figure-out a way to add reindent functionality to IDLE, patches are 
welcome.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5150
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5150] IDLE to support reindent.py

2010-10-15 Thread Roger Serwy

Roger Serwy roger.se...@gmail.com added the comment:

I grabbed the core of reindent.py and put it into an extension, unmodified. 

The original reindent.py will emit Indentation Errors if they exist. 
ScriptBinding already has nice code to handle these problems by highlighting 
the error, placing the cursor at the error, and presenting a message box. 
Rather than duplicate this code, this extension makes calls into ScriptBinding 
to check for syntax errors when the core reindent code throws exceptions.

--
Added file: http://bugs.python.org/file19247/ReindentExtension.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5150
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5150] IDLE to support reindent.py

2010-07-10 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
nosy: +merwok
resolution: accepted - fixed
stage: needs patch - committed/rejected

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5150
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5150] IDLE to support reindent.py

2009-08-13 Thread Guilherme Polo

Guilherme Polo ggp...@gmail.com added the comment:

This has been closed but why not promote reindent.py to a module and add
an option on IDLE to allow a complete reindent.py run ?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5150
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5150] IDLE to support reindent.py

2009-05-28 Thread Roger Serwy

Roger Serwy roger.se...@gmail.com added the comment:

Here's an extension that adds rstrip() to the Format menu.

--
nosy: +serwy
Added file: http://bugs.python.org/file14108/RstripExtension.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5150
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5150] IDLE to support reindent.py

2009-05-28 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

Applied in r72999.  Will backport to 2.7.

--
assignee: kbk - rhettinger
resolution:  - accepted

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5150
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5150] IDLE to support reindent.py

2009-05-28 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

Backported in r73001

--
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5150
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5150] IDLE to support reindent.py

2009-04-26 Thread Daniel Diniz

Changes by Daniel Diniz aja...@gmail.com:


--
nosy: +gpolo
stage:  - needs patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5150
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5150] IDLE to support reindent.py

2009-02-06 Thread Terry J. Reedy

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

If the interactive interpreter did not require blank lines within blocks
to have at least one 'trailing' space to avoid prematurely ending the
block (as when copy from editor window and paste), IDLE could
automatically rstrip lines.  Given that that should not be done, a menu
item would be nice.

--
nosy: +tjreedy

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5150
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5150] IDLE to support reindent.py

2009-02-04 Thread Raymond Hettinger

New submission from Raymond Hettinger rhettin...@users.sourceforge.net:

Add rstrip() to the Format menu.

Python's svn repository no longer accepts files with trailing whitespace
and it is often necessary to run reindent.py before submitting.  It
would be nice to have this as a built-in formatting tool.

--
assignee: kbk
components: IDLE
messages: 81131
nosy: kbk, rhettinger
priority: normal
severity: normal
status: open
title: IDLE to support reindent.py
type: feature request
versions: Python 2.7, Python 3.1

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5150
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com