Fix pep8.py and its invocation.
authorChris Rivera <cmr@litl.com>
Wed, 20 May 2009 23:29:33 +0000 (19:29 -0400)
committerJohan Dahlin <johan@gnome.org>
Thu, 28 May 2009 15:43:16 +0000 (12:43 -0300)
pep8.py:input_file() normally returns the number of errors found in a
given file, but it returns an empty dict if the file is excluded.  Change
it to return 0 instead.

config.py is auto-generated with a prefix that may be longer than
80 characters.  Exclude config.py in the pep8.py check.  This fixes
4042.

Makefile.am
misc/pep8.py

index 2a4de03..4bb0e24 100644 (file)
@@ -53,6 +53,6 @@ upload-release: $(distdir).tar.gz
 
 check-local:
        @echo "  PEP-8 INQUISITION"
-       @find $(top_srcdir)/giscanner -name \*.py | sort | uniq | xargs $(PYTHON) $(top_srcdir)/misc/pep8.py --repeat
+       @find $(top_srcdir)/giscanner -name \*.py | sort | uniq | xargs $(PYTHON) $(top_srcdir)/misc/pep8.py --repeat --exclude=config.py
        @echo "  CHECK Pyflakes"
        @find $(top_srcdir)/giscanner -name \*.py | sort | uniq | xargs $(PYTHON) $(top_srcdir)/misc/pyflakes.py
index 3b6248c..fef8a54 100644 (file)
@@ -647,7 +647,7 @@ def input_file(filename):
     Run all checks on a Python source file.
     """
     if excluded(filename) or not filename_match(filename):
-        return {}
+        return 0
     if options.verbose:
         message('checking ' + filename)
     options.counters['files'] = options.counters.get('files', 0) + 1