check-webkit-style generates bogus warning for StructuredExceptionHandlerSupressor.h
authorlevin@chromium.org <levin@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Sep 2011 00:38:09 +0000 (00:38 +0000)
committerlevin@chromium.org <levin@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Sep 2011 00:38:09 +0000 (00:38 +0000)
https://bugs.webkit.org/show_bug.cgi?id=68391

Reviewed by Darin Adler.

* Scripts/webkitpy/style/checkers/cpp.py: Skip __asm lines when doing style checks on a line.
* Scripts/webkitpy/style/checkers/cpp_unittest.py: Added a test for this.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95499 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/style/checkers/cpp.py
Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py

index 1799bbd..a22489f 100644 (file)
@@ -1,3 +1,13 @@
+2011-09-19  David Levin  <levin@chromium.org>
+
+        check-webkit-style generates bogus warning for StructuredExceptionHandlerSupressor.h
+        https://bugs.webkit.org/show_bug.cgi?id=68391
+
+        Reviewed by Darin Adler.
+
+        * Scripts/webkitpy/style/checkers/cpp.py: Skip __asm lines when doing style checks on a line.
+        * Scripts/webkitpy/style/checkers/cpp_unittest.py: Added a test for this.
+
 2011-09-19  Alexis Menard  <alexis.menard@openbossa.org>
 
         Style checker should not check public Qt WK2 API for parameter_name.
index 7ded5b1..52ffae3 100644 (file)
@@ -3403,6 +3403,8 @@ def process_line(filename, file_extension,
     check_for_function_lengths(clean_lines, line, function_state, error)
     if search(r'\bNOLINT\b', raw_lines[line]):  # ignore nolint lines
         return
+    if match(r'\s*\b__asm\b', raw_lines[line]):  # Ignore asm lines as they format differently.
+        return
     check_function_definition(filename, file_extension, clean_lines, line, function_state, error)
     check_pass_ptr_usage(clean_lines, line, function_state, error)
     check_for_multiline_comments_and_strings(clean_lines, line, error)
index 4322b40..37eab33 100644 (file)
@@ -615,6 +615,11 @@ class FunctionDetectionTest(CppStyleTestBase):
 
 class CppStyleTest(CppStyleTestBase):
 
+    def test_asm_lines_ignored(self):
+        self.assert_lint(
+            '__asm mov [registration], eax',
+            '')
+
     # Test get line width.
     def test_get_line_width(self):
         self.assertEquals(0, cpp_style.get_line_width(''))