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

hamaji at chromium.org hamaji at chromium.org
Thu Apr 8 02:13:31 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 3530b44f525c12b121affbd3ab73a5a7863813e8
Author: hamaji at chromium.org <hamaji at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Mar 8 06:55:55 2010 +0000

    2010-03-07  Shinichiro Hamaji  <hamaji at chromium.org>
    
            Reviewed by Eric Seidel.
    
            check-webkit-style: false positive for empty loop
            https://bugs.webkit.org/show_bug.cgi?id=35717
    
            * Scripts/webkitpy/style/processors/cpp.py:
            * Scripts/webkitpy/style/processors/cpp_unittest.py:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55656 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 8cae705..a2da152 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,13 @@
+2010-03-07  Shinichiro Hamaji  <hamaji at chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        check-webkit-style: false positive for empty loop
+        https://bugs.webkit.org/show_bug.cgi?id=35717
+
+        * Scripts/webkitpy/style/processors/cpp.py:
+        * Scripts/webkitpy/style/processors/cpp_unittest.py:
+
 2010-03-07  Kent Tamura  <tkent at chromium.org>
 
         Reviewed by Dimitri Glazkov.
diff --git a/WebKitTools/Scripts/webkitpy/style/processors/cpp.py b/WebKitTools/Scripts/webkitpy/style/processors/cpp.py
index 17bf84a..814b607 100644
--- a/WebKitTools/Scripts/webkitpy/style/processors/cpp.py
+++ b/WebKitTools/Scripts/webkitpy/style/processors/cpp.py
@@ -1652,7 +1652,7 @@ def check_braces(clean_lines, line_number, error):
         # We check if a closed brace has started a line to see if a
         # one line control statement was previous.
         previous_line = clean_lines.elided[line_number - 2]
-        if (previous_line.find('{') > 0
+        if (previous_line.find('{') > 0 and previous_line.find('}') < 0
             and search(r'\b(if|for|foreach|while|else)\b', previous_line)):
             error(line_number, 'whitespace/braces', 4,
                   'One line control clauses should not use braces.')
diff --git a/WebKitTools/Scripts/webkitpy/style/processors/cpp_unittest.py b/WebKitTools/Scripts/webkitpy/style/processors/cpp_unittest.py
index 4398d2e..c4738f9 100644
--- a/WebKitTools/Scripts/webkitpy/style/processors/cpp_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/style/processors/cpp_unittest.py
@@ -3064,6 +3064,20 @@ class WebKitStyleTest(CppStyleTestBase):
             '}\n',
             ['More than one command on the same line in if  [whitespace/parens] [4]',
              'One line control clauses should not use braces.  [whitespace/braces] [4]'])
+        self.assert_multi_line_lint(
+            'void func()\n'
+            '{\n'
+            '    while (condition) { }\n'
+            '    return 0;\n'
+            '}\n',
+            '')
+        self.assert_multi_line_lint(
+            'void func()\n'
+            '{\n'
+            '    for (i = 0; i < 42; i++) { foobar(); }\n'
+            '    return 0;\n'
+            '}\n',
+            'More than one command on the same line in for  [whitespace/parens] [4]')
 
         # 3. An else if statement should be written as an if statement
         #    when the prior if concludes with a return statement.

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list