[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Thu Apr 8 01:11:39 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit ffabf5c8ecfc6ab22d2638987901ff7531d1f36c
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Jan 18 02:39:12 2010 +0000

    2010-01-17  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Darin Adler.
    
            style-check script reports loads of errors on gtk2drawing.c
            https://bugs.webkit.org/show_bug.cgi?id=33771
    
            Exempt WebCore/platform/gtk/gtk2drawing.c and
            WebCore/platform/gtk/gtk2drawing.h from style checks.
    
            * Scripts/webkitpy/style/cpp_style.py:
            * Scripts/webkitpy/style/cpp_style_unittest.py:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53383 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 6c3ff69..267b144 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,16 @@
+2010-01-17  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Darin Adler.
+
+        style-check script reports loads of errors on gtk2drawing.c
+        https://bugs.webkit.org/show_bug.cgi?id=33771
+
+        Exempt WebCore/platform/gtk/gtk2drawing.c and
+        WebCore/platform/gtk/gtk2drawing.h from style checks.
+
+        * Scripts/webkitpy/style/cpp_style.py:
+        * Scripts/webkitpy/style/cpp_style_unittest.py:
+
 2010-01-17  Chris Jerdonek  <cjerdonek at webkit.org>
 
         Reviewed by Shinichiro Hamaji.
diff --git a/WebKitTools/Scripts/webkitpy/style/cpp_style.py b/WebKitTools/Scripts/webkitpy/style/cpp_style.py
index c4d3445..6dd6c5f 100644
--- a/WebKitTools/Scripts/webkitpy/style/cpp_style.py
+++ b/WebKitTools/Scripts/webkitpy/style/cpp_style.py
@@ -2897,6 +2897,8 @@ def process_file(filename, error, verbosity):
     # should rely on the extension.
     if (filename != '-' and not can_handle(filename)):
         sys.stderr.write('Ignoring %s; not a .cpp, .c or .h file\n' % filename)
+    elif is_exempt(filename):
+        sys.stderr.write('Ignoring %s; This file is exempt from the style guide.\n' % filename)
     else:
         process_file_data(filename, file_extension, lines, error, verbosity)
         if carriage_return_found and os.linesep != '\r\n':
@@ -2914,3 +2916,17 @@ def can_handle(filename):
       filename: A filename. It may contain directory names.
      """
     return os.path.splitext(filename)[1] in ('.h', '.cpp', '.c')
+
+
+def is_exempt(filename):
+    """Checks if the given file is exempt from the style guide.  For example,
+    some files are purposefully mantained in Mozilla style to ease future
+    merges.
+
+    Args:
+      filename: A filename. It may contain directory names.
+     """
+    return os.path.basename(filename) in (
+        'gtk2drawing.c',
+        'gtk2drawing.h',
+    )
diff --git a/WebKitTools/Scripts/webkitpy/style/cpp_style_unittest.py b/WebKitTools/Scripts/webkitpy/style/cpp_style_unittest.py
index 2dfe451..509b2c5 100644
--- a/WebKitTools/Scripts/webkitpy/style/cpp_style_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/style/cpp_style_unittest.py
@@ -3599,6 +3599,18 @@ class WebKitStyleTest(CppStyleTestBase):
         self.assert_(not cpp_style.can_handle('foo.mm'))
         self.assert_(not cpp_style.can_handle('-'))
 
+    def test_is_exempt(self):
+        """Tests for cpp_style.is_exempt()."""
+        self.assert_(not cpp_style.is_exempt(''))
+        self.assert_(not cpp_style.is_exempt('foo.h'))
+        self.assert_(not cpp_style.is_exempt('foo.hpp'))
+        self.assert_(not cpp_style.is_exempt('foo.c'))
+        self.assert_(not cpp_style.is_exempt('foo.cpp'))
+        self.assert_(not cpp_style.is_exempt('-'))
+        self.assert_(cpp_style.is_exempt('gtk2drawing.h'))
+        self.assert_(cpp_style.is_exempt('WebCore/platform/gtk/gtk2drawing.h'))
+        self.assert_(cpp_style.is_exempt('gtk2drawing.c'))
+        self.assert_(cpp_style.is_exempt('WebCore/platform/gtk/gtk2drawing.c'))
 
 def tearDown():
     """A global check to make sure all error-categories have been tested.

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list