Re: [Python-Dev] whitespace normalization pre-commit hook is giving me grief

2007-05-29 Thread Brett Cannon
On 5/28/07, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: Brett Cannon schrieb: > Unfortunately the pre-commit hook > does not specify what line a change was made on so I have no clue where > it is failing (maybe this should be added?). It creates a reindent.Reindenter on the new contents, then

Re: [Python-Dev] whitespace normalization pre-commit hook is giving me grief

2007-05-29 Thread Georg Brandl
Martin v. Löwis schrieb: >> As I said before, you don't really need that when you can (and should!) just >> run >> reindent.py over the source file yourself, not care about any diffs and just >> resubmit. > > Right. So I withdraw my offer to do anything about the hook. I think printing something

Re: [Python-Dev] whitespace normalization pre-commit hook is giving me grief

2007-05-29 Thread Martin v. Löwis
> As I said before, you don't really need that when you can (and should!) just > run > reindent.py over the source file yourself, not care about any diffs and just > resubmit. Right. So I withdraw my offer to do anything about the hook. Regards, Martin ___

Re: [Python-Dev] whitespace normalization pre-commit hook is giving me grief

2007-05-29 Thread Georg Brandl
Scott Dial schrieb: > Martin v. Löwis wrote: >> Brett Cannon schrieb: >>> Unfortunately the pre-commit hook >>> does not specify what line a change was made on so I have no clue where >>> it is failing (maybe this should be added?). >> >> It creates a reindent.Reindenter on the new contents, then

Re: [Python-Dev] whitespace normalization pre-commit hook is giving me grief

2007-05-29 Thread Scott Dial
Martin v. Löwis wrote: > Brett Cannon schrieb: >> Unfortunately the pre-commit hook >> does not specify what line a change was made on so I have no clue where >> it is failing (maybe this should be added?). > > It creates a reindent.Reindenter on the new contents, then invokes > .run() on it, and

Re: [Python-Dev] whitespace normalization pre-commit hook is giving me grief

2007-05-28 Thread Martin v. Löwis
Brett Cannon schrieb: > Unfortunately the pre-commit hook > does not specify what line a change was made on so I have no clue where > it is failing (maybe this should be added?). It creates a reindent.Reindenter on the new contents, then invokes .run() on it, and complains if that returns true. If

Re: [Python-Dev] whitespace normalization pre-commit hook is giving me grief

2007-05-26 Thread Brett Cannon
On 5/26/07, Neal Norwitz <[EMAIL PROTECTED]> wrote: On 5/26/07, Brett Cannon <[EMAIL PROTECTED]> wrote: > > > On 5/25/07, Georg Brandl <[EMAIL PROTECTED]> wrote: > > Neal Norwitz schrieb: > > > On 5/25/07, Brett Cannon <[EMAIL PROTECTED]> wrote: > > >> In my bcannon-objcap branch I am trying to

Re: [Python-Dev] whitespace normalization pre-commit hook is giving me grief

2007-05-26 Thread Neal Norwitz
On 5/26/07, Brett Cannon <[EMAIL PROTECTED]> wrote: > > > On 5/25/07, Georg Brandl <[EMAIL PROTECTED]> wrote: > > Neal Norwitz schrieb: > > > On 5/25/07, Brett Cannon <[EMAIL PROTECTED]> wrote: > > >> In my bcannon-objcap branch I am trying to check in a change that > involves a > > >> soft symlink

Re: [Python-Dev] whitespace normalization pre-commit hook is giving me grief

2007-05-26 Thread Brett Cannon
On 5/25/07, Georg Brandl <[EMAIL PROTECTED]> wrote: Neal Norwitz schrieb: > On 5/25/07, Brett Cannon <[EMAIL PROTECTED]> wrote: >> In my bcannon-objcap branch I am trying to check in a change that involves a >> soft symlink from Lib/controlled_importlib.py to >> ../importlib/controlled_importlib

Re: [Python-Dev] whitespace normalization pre-commit hook is giving me grief

2007-05-26 Thread Brett Cannon
On 5/25/07, Neal Norwitz <[EMAIL PROTECTED]> wrote: On 5/25/07, Brett Cannon <[EMAIL PROTECTED]> wrote: > In my bcannon-objcap branch I am trying to check in a change that involves a > soft symlink from Lib/controlled_importlib.py to > ../importlib/controlled_importlib.py through ``ln -s > ../co

Re: [Python-Dev] whitespace normalization pre-commit hook is giving me grief

2007-05-25 Thread Georg Brandl
Neal Norwitz schrieb: > On 5/25/07, Brett Cannon <[EMAIL PROTECTED]> wrote: >> In my bcannon-objcap branch I am trying to check in a change that involves a >> soft symlink from Lib/controlled_importlib.py to >> ../importlib/controlled_importlib.py through ``ln -s >> ../controlled_importlib.py contr

Re: [Python-Dev] whitespace normalization pre-commit hook is giving me grief

2007-05-25 Thread Neal Norwitz
On 5/25/07, Brett Cannon <[EMAIL PROTECTED]> wrote: > In my bcannon-objcap branch I am trying to check in a change that involves a > soft symlink from Lib/controlled_importlib.py to > ../importlib/controlled_importlib.py through ``ln -s > ../controlled_importlib.py controlled_importlib.py`` while i

[Python-Dev] whitespace normalization pre-commit hook is giving me grief

2007-05-25 Thread Brett Cannon
In my bcannon-objcap branch I am trying to check in a change that involves a soft symlink from Lib/controlled_importlib.py to ../importlib/controlled_importlib.py through ``ln -s ../controlled_importlib.py controlled_importlib.py`` while in the Lib directory. I have done this before in this branc

Re: [Python-Dev] whitespace normalization

2007-04-27 Thread skip
> Just a little FYI, python-mode (the one Barry and I manage - dunno > about the one distributed w/ GNU Emacs these days) is one of those > tools that leaves trailing whitespace behind when advancing to the > next line.. Okay, I figured this out. The dangling whitespace turds are

Re: [Python-Dev] whitespace normalization

2007-04-26 Thread Christian Tanzer
Greg Ewing <[EMAIL PROTECTED]> wrote: > Stripping trailing whitespace on saving wouldn't be > so bad, though. Is there an option for that in python-mode? I've got thje following in my ~/.emacs: (if (fboundp 'delete-trailing-whitespace) (add-hook 'write-file-hooks 'delete-trailing-whitespace

Re: [Python-Dev] whitespace normalization

2007-04-25 Thread Georg Brandl
Martin v. Löwis schrieb: >> Okay, attached is a pre-commit hook script for that purpose. > > How does that deal with deletions? Ah, you'd have to look at the first two chars of every lines that I cut away. > What do you think about > the attached alternative? I'd say it's better since it uses t

Re: [Python-Dev] whitespace normalization

2007-04-25 Thread Martin v. Löwis
> Okay, attached is a pre-commit hook script for that purpose. How does that deal with deletions? What do you think about the attached alternative? Regards, Martin #!/usr/bin/env python from svn import repos, fs, core import sys from StringIO import StringIO from reindent import Reindenter repos

Re: [Python-Dev] whitespace normalization

2007-04-25 Thread skip
>> Just a little FYI, python-mode (the one Barry and I manage - dunno >> about the one distributed w/ GNU Emacs these days) is one of those >> tools that leaves trailing whitespace behind when advancing to the >> next line.. (See my earlier retraction...) Greg> I get extremel

Re: [Python-Dev] whitespace normalization

2007-04-25 Thread Greg Ewing
[EMAIL PROTECTED] wrote: > Just a little FYI, python-mode (the one Barry and I manage - dunno about the > one distributed w/ GNU Emacs these days) is one of those tools that leaves > trailing whitespace behind when advancing to the next line.. I get extremely annoyed with editors that *don't* leav

Re: [Python-Dev] whitespace normalization

2007-04-25 Thread Tim Peters
[Skip] > Just a little FYI, python-mode (the one Barry and I manage - dunno about the > one distributed w/ GNU Emacs these days) is one of those tools that leaves > trailing whitespace behind when advancing to the next line.. Shouldn't be -- unless the behavior of the Emacs newline-and-indent has

Re: [Python-Dev] whitespace normalization

2007-04-25 Thread glyph
On 08:15 pm, [EMAIL PROTECTED] wrote: ;; untabify and clean up lines with just whitespace (defun baw-whitespace-normalization () Looks a lot like (whitespace-cleanup), if you've got the right configuration. A function I've used many times :). ___ Py

Re: [Python-Dev] whitespace normalization

2007-04-25 Thread Terry Reedy
"Guido van Rossum" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | On 4/25/07, Georg Brandl <[EMAIL PROTECTED]> wrote: | > Well, there are editors that don't intelligently strip whitespace, so that | > people using them would be constantly pained by such a hook. | | And they should

Re: [Python-Dev] whitespace normalization

2007-04-25 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Apr 25, 2007, at 2:37 PM, [EMAIL PROTECTED] wrote: >>> Well, there are editors that don't intelligently strip >>> whitespace, so >>> that people using them would be constantly pained by such a hook. > > Guido> And they should. There really is

Re: [Python-Dev] whitespace normalization

2007-04-25 Thread Georg Brandl
[EMAIL PROTECTED] schrieb: > skip> Just a little FYI, python-mode (the one Barry and I manage - dunno > skip> about the one distributed w/ GNU Emacs these days) is one of those > skip> tools that leaves trailing whitespace behind when advancing to the > skip> next line.. > > At lea

Re: [Python-Dev] whitespace normalization

2007-04-25 Thread skip
skip> Just a little FYI, python-mode (the one Barry and I manage - dunno skip> about the one distributed w/ GNU Emacs these days) is one of those skip> tools that leaves trailing whitespace behind when advancing to the skip> next line.. At least so I thiought. I know I've seen th

Re: [Python-Dev] whitespace normalization

2007-04-25 Thread Guido van Rossum
On 4/25/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > >> Well, there are editors that don't intelligently strip whitespace, so > >> that people using them would be constantly pained by such a hook. > > Guido> And they should. There really is no excuse for letting one > Guido> d

Re: [Python-Dev] whitespace normalization

2007-04-25 Thread Tim Peters
[Skip] > Maybe \s should expand to a single space by the lexer so people who want to > rely on trailing spaces can be explicit about it. There already exists > non-whitespace escape sequences for tabs and newlines. Trailing whitspace is never significant on a code line, only inside a multiline st

Re: [Python-Dev] whitespace normalization

2007-04-25 Thread skip
Tim> ... but only when the code mysteriously Tim> relied on significant trailing whitespace in the .py file. Maybe \s should expand to a single space by the lexer so people who want to rely on trailing spaces can be explicit about it. There already exists non-whitespace escape sequences

Re: [Python-Dev] whitespace normalization

2007-04-25 Thread skip
>> Well, there are editors that don't intelligently strip whitespace, so >> that people using them would be constantly pained by such a hook. Guido> And they should. There really is no excuse for letting one Guido> developer's poor choice of tools cause later grief for all other

Re: [Python-Dev] whitespace normalization

2007-04-25 Thread Georg Brandl
Guido van Rossum schrieb: On 4/25/07, Georg Brandl <[EMAIL PROTECTED]> wrote: Well, there are editors that don't intelligently strip whitespace, so that people using them would be constantly pained by such a hook. And they should. There really is no excuse for letting one developer's poor choi

Re: [Python-Dev] whitespace normalization

2007-04-25 Thread Martin v. Löwis
> Well, there are editors that don't intelligently strip whitespace, so that > people using them would be constantly pained by such a hook. Those users can run reindent.py before checking in, or switch editors. Regards, Martin ___ Python-Dev mailing li

Re: [Python-Dev] whitespace normalization

2007-04-25 Thread Martin v. Löwis
Neal Norwitz schrieb: > I just checked in a whitespace normalization change that was way too > big. Should this task be automated? > > Assuming the answer is yes, these are the questions should be answered: > 1) Which branches should this occur on: trunk, 2.5 (last release), 3k > 2) Should the

Re: [Python-Dev] whitespace normalization

2007-04-25 Thread Tim Peters
[Neal Norwitz] > ... > The way to fix the files is to run: python ./Tools/scripts/reindent.py -r Lib I apply it to everything in the checkout. That is, I run reindent.py from the root of my sandbox, and use "." instead of "Lib". The goal is that every .py file (not just under Lib/) that eventua

Re: [Python-Dev] whitespace normalization

2007-04-25 Thread Guido van Rossum
On 4/25/07, Georg Brandl <[EMAIL PROTECTED]> wrote: > Well, there are editors that don't intelligently strip whitespace, so that > people using them would be constantly pained by such a hook. And they should. There really is no excuse for letting one developer's poor choice of tools cause later gr

Re: [Python-Dev] whitespace normalization

2007-04-25 Thread Georg Brandl
Steve Holden schrieb: > Duncan Booth wrote: >> "Neal Norwitz" <[EMAIL PROTECTED]> wrote in >> news:[EMAIL PROTECTED]: >> >>> I just checked in a whitespace normalization change that was way too >>> big. Should this task be automated? >> >> IMHO, changing whitespace retrospectively in a version

Re: [Python-Dev] whitespace normalization

2007-04-25 Thread Georg Brandl
Facundo Batista schrieb: > Georg Brandl wrote: > >> Of course, we could also setup a svn pre-commit hook that rejects trailing >> whitespace >:-> > > I was about to suggest a mail to python-checkins when a bad whitespace > is detected, but had no idea that a pre-commit check existed in SVN. > >

Re: [Python-Dev] whitespace normalization

2007-04-25 Thread Facundo Batista
Georg Brandl wrote: > Of course, we could also setup a svn pre-commit hook that rejects trailing > whitespace >:-> I was about to suggest a mail to python-checkins when a bad whitespace is detected, but had no idea that a pre-commit check existed in SVN. It'd be great if the system won't let yo

Re: [Python-Dev] whitespace normalization

2007-04-25 Thread dustin
On Wed, Apr 25, 2007 at 08:40:22AM +0100, Duncan Booth wrote: > IMHO, changing whitespace retrospectively in a version control system is a > bad idea. In my experience Duncan's assertion is absolutely true, and all the more so in a project that maintains a large body of pending patches, as Python

Re: [Python-Dev] whitespace normalization

2007-04-25 Thread Fred L. Drake, Jr.
On Wednesday 25 April 2007, Steve Holden wrote: > Duncan Booth wrote: > > That way the whitespace ought to stay normalized so you shouldn't need a > > separate cleanup step and you won't be breaking diff and blame for the > > sources (and if the reindent does ever break anything it should be mo

Re: [Python-Dev] whitespace normalization

2007-04-25 Thread Steve Holden
Duncan Booth wrote: > "Neal Norwitz" <[EMAIL PROTECTED]> wrote in > news:[EMAIL PROTECTED]: > >> I just checked in a whitespace normalization change that was way too >> big. Should this task be automated? > > IMHO, changing whitespace retrospectively in a version control system is a > bad idea

Re: [Python-Dev] whitespace normalization

2007-04-25 Thread Duncan Booth
"Neal Norwitz" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > I just checked in a whitespace normalization change that was way too > big. Should this task be automated? IMHO, changing whitespace retrospectively in a version control system is a bad idea. How much overhead would it be t

Re: [Python-Dev] whitespace normalization

2007-04-25 Thread Georg Brandl
Neal Norwitz schrieb: > I just checked in a whitespace normalization change that was way too > big. Should this task be automated? > > Assuming the answer is yes, these are the questions should be answered: > 1) Which branches should this occur on: trunk, 2.5 (last release), 3k > 2) Should the

[Python-Dev] whitespace normalization

2007-04-24 Thread Neal Norwitz
I just checked in a whitespace normalization change that was way too big. Should this task be automated? Assuming the answer is yes, these are the questions should be answered: 1) Which branches should this occur on: trunk, 2.5 (last release), 3k 2) Should there be a special user for these che