[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.21-584-g1e41756

hamaji at chromium.org hamaji at chromium.org
Fri Feb 26 22:23:26 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 5e14a14d54f045c45205499cd0237f836728bc9e
Author: hamaji at chromium.org <hamaji at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Feb 18 02:00:10 2010 +0000

    2010-02-17  Shinichiro Hamaji  <hamaji at chromium.org>
    
            Reviewed by Eric Seidel.
    
            check-webkit-style should report the number of files checked
            https://bugs.webkit.org/show_bug.cgi?id=34971
    
            * Scripts/check-webkit-style:
            * Scripts/webkitpy/style/checker.py:
            * Scripts/webkitpy/style/checker_unittest.py:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54917 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index ea2da92..a81b236 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,14 @@
+2010-02-17  Shinichiro Hamaji  <hamaji at chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        check-webkit-style should report the number of files checked
+        https://bugs.webkit.org/show_bug.cgi?id=34971
+
+        * Scripts/check-webkit-style:
+        * Scripts/webkitpy/style/checker.py:
+        * Scripts/webkitpy/style/checker_unittest.py:
+
 2010-02-17  Diego Gonzalez  <diego.gonzalez at openbossa.org>
 
         Reviewed by Ariya Hidayat.
diff --git a/WebKitTools/Scripts/check-webkit-style b/WebKitTools/Scripts/check-webkit-style
index f19fe73..4b9efe5 100755
--- a/WebKitTools/Scripts/check-webkit-style
+++ b/WebKitTools/Scripts/check-webkit-style
@@ -85,8 +85,11 @@ def main():
         style_checker.check_patch(patch)
 
     error_count = style_checker.error_count
-    sys.stderr.write('Total errors found: %d\n' % error_count)
-    sys.exit(error_count > 0)
+    file_count = style_checker.file_count
+    sys.stderr.write('Total errors found: %d in %d files\n'
+                     % (error_count, file_count))
+    # We fail when style errors are found or there are no checked files.
+    sys.exit(error_count > 0 or file_count == 0)
 
 
 if __name__ == "__main__":
diff --git a/WebKitTools/Scripts/webkitpy/style/checker.py b/WebKitTools/Scripts/webkitpy/style/checker.py
index d455f23..2fff84c 100644
--- a/WebKitTools/Scripts/webkitpy/style/checker.py
+++ b/WebKitTools/Scripts/webkitpy/style/checker.py
@@ -703,6 +703,9 @@ class StyleChecker(object):
                       instance.
          options: A ProcessorOptions instance that controls the behavior
                   of style checking.
+         file_count: An integer that is the total number of processed
+                     files.  Note that the number of skipped files is
+                     included in this value.
 
     """
 
@@ -723,6 +726,7 @@ class StyleChecker(object):
         self._stderr_write = stderr_write
         self.error_count = 0
         self.options = options
+        self.file_count = 0
 
     def _increment_error_count(self):
         """Increment the total count of reported errors."""
@@ -795,6 +799,8 @@ class StyleChecker(object):
         if process_file is None:
             process_file = self._process_file
 
+        self.file_count += 1
+
         dispatcher = ProcessorDispatcher()
 
         if dispatcher.should_skip_without_warning(file_path):
@@ -829,4 +835,3 @@ class StyleChecker(object):
                                       self._stderr_write)
 
             self.check_file(file_path, style_error_handler)
-
diff --git a/WebKitTools/Scripts/webkitpy/style/checker_unittest.py b/WebKitTools/Scripts/webkitpy/style/checker_unittest.py
index 728c106..29c1b6c 100755
--- a/WebKitTools/Scripts/webkitpy/style/checker_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/style/checker_unittest.py
@@ -569,6 +569,7 @@ class StyleCheckerTest(unittest.TestCase):
 
         self.assertEquals(style_checker.error_count, 0)
         self.assertEquals(style_checker.options, options)
+        self.assertEquals(style_checker.file_count, 0)
 
 
 class StyleCheckerCheckFileTest(unittest.TestCase):
@@ -649,6 +650,8 @@ class StyleCheckerCheckFileTest(unittest.TestCase):
                                  self.mock_handle_style_error,
                                  self.mock_process_file)
 
+        self.assertEquals(1, style_checker.file_count)
+
     def test_check_file_on_skip_without_warning(self):
         """Test check_file() for a skipped-without-warning file."""
 
@@ -704,4 +707,3 @@ if __name__ == '__main__':
     import sys
 
     unittest.main()
-

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list