A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2007-May/073512.html below:

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

[Python-Dev] whitespace normalization pre-commit hook is giving me grief [Python-Dev] whitespace normalization pre-commit hook is giving me griefScott Dial scott+python-dev at scottdial.com
Tue May 29 09:26:56 CEST 2007
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 complains if that returns true. If you can come
> up with a patch to reindent that makes it report more detailed
> errors, please post it, and I'll try to merge it into the hook
> script.
> 

How about you do:

     if reindenter.run():
         print >>sys.stderr, "file %s is not whitespace-normalized" %path
	print >>sys.stderr, difflib.unified_diff(reindenter.raw,
                                                  reindenter.after)
         bad += 1

Which would provide you a unified diff to give you a clue.

-- 
Scott Dial
scott at scottdial.com
scodial at cs.indiana.edu
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4