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

levin at chromium.org levin at chromium.org
Thu Apr 8 00:28:02 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit a6a6c718cf852c21e0a53ff7e06d9c69620800ca
Author: levin at chromium.org <levin at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Dec 8 18:55:20 2009 +0000

    [check-webkit-style] False positive for camel case of JSC op codes
    https://bugs.webkit.org/show_bug.cgi?id=32192
    
    Reviewed by Adam Barth.
    
    * Scripts/modules/cpp_style.py: Added an exception for the JSC op
      code functions and const_iterator as well since I noticed a false
      positive there when testing the fix.
    * Scripts/modules/cpp_style_unittest.py: Added tests for these
      changes.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51866 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 8e5a0a2..1d8e83b 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,16 @@
+2009-12-08  David Levin  <levin at chromium.org>
+
+        Reviewed by Adam Barth.
+
+        [check-webkit-style] False positive for camel case of JSC op codes
+        https://bugs.webkit.org/show_bug.cgi?id=32192
+
+        * Scripts/modules/cpp_style.py: Added an exception for the JSC op
+          code functions and const_iterator as well since I noticed a false
+          positive there when testing the fix.
+        * Scripts/modules/cpp_style_unittest.py: Added tests for these
+          changes.
+
 2009-12-08  Nikolas Zimmermann  <nzimmermann at rim.com>
 
         Rubber-stamped by Maciej Stachowiak.
diff --git a/WebKitTools/Scripts/modules/cpp_style.py b/WebKitTools/Scripts/modules/cpp_style.py
index 5b62d6d..37d7414 100644
--- a/WebKitTools/Scripts/modules/cpp_style.py
+++ b/WebKitTools/Scripts/modules/cpp_style.py
@@ -2734,7 +2734,10 @@ def check_identifier_name_in_declaration(filename, line_number, line, error):
         # Remove "m_" and "s_" to allow them.
         modified_identifier = sub(r'(^|(?<=::))[ms]_', '', identifier)
         if modified_identifier.find('_') >= 0:
-            error(filename, line_number, 'readability/naming', 4, identifier + " is incorrectly named. Don't use underscores in your identifier names.")
+            # Various exceptions to the rule: JavaScript op codes functions, const_iterator.
+            if (not (filename.find('JavaScriptCore') >= 0 and modified_identifier.find('_op_') >= 0)
+                and not modified_identifier == "const_iterator"):
+                error(filename, line_number, 'readability/naming', 4, identifier + " is incorrectly named. Don't use underscores in your identifier names.")
 
         # There can be only one declaration in non-for-control statements.
         if control_statement:
diff --git a/WebKitTools/Scripts/modules/cpp_style_unittest.py b/WebKitTools/Scripts/modules/cpp_style_unittest.py
index 59e752e..7cddde0 100644
--- a/WebKitTools/Scripts/modules/cpp_style_unittest.py
+++ b/WebKitTools/Scripts/modules/cpp_style_unittest.py
@@ -3693,6 +3693,14 @@ class WebKitStyleTest(CppStyleTestBase):
                          ['variable_1' + name_error_message,
                           'variable_2' + name_error_message])
 
+        # There is an exception for op code functions but only in the JavaScriptCore directory.
+        self.assert_lint('void this_op_code(int var1, int var2)', '', 'JavaScriptCore/foo.cpp')
+        self.assert_lint('void this_op_code(int var1, int var2)', 'this_op_code' + name_error_message)
+
+        # const_iterator is allowed as well.
+        self.assert_lint('typedef VectorType::const_iterator const_iterator;', '')
+
+
     def test_other(self):
         # FIXME: Implement this.
         pass

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list