[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

levin at chromium.org levin at chromium.org
Wed Dec 22 15:46:59 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 24e5f276557c328e55e66507e66fed3d9b237db5
Author: levin at chromium.org <levin at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Nov 12 06:37:33 2010 +0000

    2010-11-11  David Levin  <levin at chromium.org>
    
            Reviewed by Shinichiro Hamaji.
    
            check-webkit-style function detection doesn't work for templates and destructors.
            https://bugs.webkit.org/show_bug.cgi?id=49425
    
            * Scripts/webkitpy/style/checkers/cpp.py: Changed regex for templates and destructors.
            * Scripts/webkitpy/style/checkers/cpp_unittest.py: Made the test hit this issue.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71890 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 79b9c24..f3405ca 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,13 @@
+2010-11-11  David Levin  <levin at chromium.org>
+
+        Reviewed by Shinichiro Hamaji.
+
+        check-webkit-style function detection doesn't work for templates and destructors.
+        https://bugs.webkit.org/show_bug.cgi?id=49425
+
+        * Scripts/webkitpy/style/checkers/cpp.py: Changed regex for templates and destructors.
+        * Scripts/webkitpy/style/checkers/cpp_unittest.py: Made the test hit this issue.
+
 2010-11-11  Joone Hur  <joone at kldp.org>
 
         Reviewed by Antonio Gomes.
diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py b/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py
index cd9e6ae..91e2c1e 100644
--- a/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py
@@ -325,7 +325,7 @@ class _FunctionState(object):
                       self.current_function, self.lines_in_function, trigger))
 
     def end(self):
-        """Stop analizing function body."""
+        """Stop analyzing function body."""
         self.in_a_function = False
 
 
@@ -1137,7 +1137,7 @@ def check_for_function_lengths(clean_lines, line_number, function_state, error):
     joined_line = ''
 
     starting_func = False
-    regexp = r'(\w(\w|::|\*|\&|\s)*)\('  # decls * & space::name( ...
+    regexp = r'(\w(\w|::|\*|\&|\s|<|>|,|~)*)\('  # decls * & space::name( ...
     match_result = match(regexp, line)
     if match_result:
         # If the name is all caps and underscores, figure it's a macro and
@@ -1156,7 +1156,7 @@ def check_for_function_lengths(clean_lines, line_number, function_state, error):
                 break                              # ... ignore
             if search(r'{', start_line):
                 body_found = True
-                function = search(r'((\w|:)*)\(', line).group(1)
+                function = search(r'((\w|:|<|>|,|~)*)\(', line).group(1)
                 if match(r'TEST', function):    # Handle TEST... macros
                     parameter_regexp = search(r'(\(.*\))', joined_line)
                     if parameter_regexp:             # Ignore bad syntax
diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py b/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py
index 6d5c24b..6b42ffa 100644
--- a/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py
@@ -2448,12 +2448,13 @@ class CheckForFunctionLengthsTest(CppStyleTestBase):
         error_level = 1
         error_lines = self.trigger_lines(error_level) + 1
         trigger_level = self.trigger_lines(self.min_confidence)
+        # FIXME: handle spaces in the template parameters
         self.assert_function_lengths_check(
-            ('my_namespace::my_other_namespace::MyVeryLongTypeName*\n'
-             'my_namespace::my_other_namespace::MyFunction(int arg1, char* arg2)'
+            ('my_namespace::my_other_namespace::MyVeryLongTypeName<Type1>*\n'
+             'my_namespace::my_other_namespace<Type2,Type3>::~MyFunction<Type4>(int arg1, char* arg2)'
              + self.function_body(error_lines)),
             ('Small and focused functions are preferred: '
-             'my_namespace::my_other_namespace::MyFunction()'
+             'my_namespace::my_other_namespace<Type2,Type3>::~MyFunction<Type4>()'
              ' has %d non-comment lines '
              '(error triggered by exceeding %d lines).'
              '  [readability/fn_size] [%d]')

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list