Title: [191538] trunk/Tools
Revision
191538
Author
[email protected]
Date
2015-10-24 16:36:19 -0700 (Sat, 24 Oct 2015)

Log Message

check-webkit-style complains about missing operator whitespace inside character literal
https://bugs.webkit.org/show_bug.cgi?id=150396

Reviewed by Darin Adler.

* Scripts/webkitpy/style/checkers/cpp.py: Improve matching of C++ character literal.
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(WebKitStyleTest.test_spacing): Add a test to verify that the spacing for the character literal 'OS/2' is not tested.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (191537 => 191538)


--- trunk/Tools/ChangeLog	2015-10-24 21:39:37 UTC (rev 191537)
+++ trunk/Tools/ChangeLog	2015-10-24 23:36:19 UTC (rev 191538)
@@ -1,3 +1,14 @@
+2015-10-24  Frederic Wang  <[email protected]>
+
+        check-webkit-style complains about missing operator whitespace inside character literal
+        https://bugs.webkit.org/show_bug.cgi?id=150396
+
+        Reviewed by Darin Adler.
+
+        * Scripts/webkitpy/style/checkers/cpp.py: Improve matching of C++ character literal.
+        * Scripts/webkitpy/style/checkers/cpp_unittest.py:
+        (WebKitStyleTest.test_spacing): Add a test to verify that the spacing for the character literal 'OS/2' is not tested.
+
 2015-10-23  Michael Saboff  <[email protected]>
 
         REGRESSION (r179357-r179359): WebContent Crash using AOL Mail @ com.apple._javascript_Core JSC::linkPolymorphicCall(JSC::ExecState*, JSC::CallLinkInfo&, JSC::CallVariant, JSC::RegisterPreservationMode) + 1584

Modified: trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py (191537 => 191538)


--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py	2015-10-24 21:39:37 UTC (rev 191537)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py	2015-10-24 23:36:19 UTC (rev 191538)
@@ -685,7 +685,7 @@
 # Matches strings.  Escape codes should already be removed by ESCAPES.
 _RE_PATTERN_CLEANSE_LINE_DOUBLE_QUOTES = re.compile(r'"[^"]*"')
 # Matches characters.  Escape codes should already be removed by ESCAPES.
-_RE_PATTERN_CLEANSE_LINE_SINGLE_QUOTES = re.compile(r"'.'")
+_RE_PATTERN_CLEANSE_LINE_SINGLE_QUOTES = re.compile(r"'[^']{1,4}'")
 # Matches multi-line C++ comments.
 # This RE is a little bit more complicated than one might expect, because we
 # have to take care of space removals tools so we can handle comments inside

Modified: trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py (191537 => 191538)


--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py	2015-10-24 21:39:37 UTC (rev 191537)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py	2015-10-24 23:36:19 UTC (rev 191538)
@@ -4015,6 +4015,11 @@
             ['Extra space after ( in function call  [whitespace/parens] [4]',
              'Extra space before )  [whitespace/parens] [2]'])
 
+        # Ignore spacing inside four char code.
+        self.assert_multi_line_lint(
+            'CTFontTableTag os2Tag = \'OS/2\';',
+            '')
+
     def test_line_breaking(self):
         # 1. Each statement should get its own line.
         self.assert_multi_line_lint(
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to