Title: [90965] trunk/Tools
Revision
90965
Author
[email protected]
Date
2011-07-13 16:45:17 -0700 (Wed, 13 Jul 2011)

Log Message

Fix WTF header guard style check
https://bugs.webkit.org/show_bug.cgi?id=64488

Reviewed by David Levin.

* Scripts/webkitpy/style/checkers/cpp.py:
* Scripts/webkitpy/style/checkers/cpp_unittest.py: Verify that we don't *always* suggest "WTF_" as a prefix

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (90964 => 90965)


--- trunk/Tools/ChangeLog	2011-07-13 23:31:03 UTC (rev 90964)
+++ trunk/Tools/ChangeLog	2011-07-13 23:45:17 UTC (rev 90965)
@@ -1,3 +1,13 @@
+2011-07-13  Ilya Sherman  <[email protected]>
+
+        Fix WTF header guard style check
+        https://bugs.webkit.org/show_bug.cgi?id=64488
+
+        Reviewed by David Levin.
+
+        * Scripts/webkitpy/style/checkers/cpp.py:
+        * Scripts/webkitpy/style/checkers/cpp_unittest.py: Verify that we don't *always* suggest "WTF_" as a prefix
+
 2011-07-13  Ojan Vafai  <[email protected]>
 
         bring flakiness_dashboard.html closer to webkit style

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


--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py	2011-07-13 23:31:03 UTC (rev 90964)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py	2011-07-13 23:45:17 UTC (rev 90965)
@@ -923,7 +923,7 @@
     standard_name = sub(r'[-.\s]', '_', os.path.basename(filename))
 
     # Files under WTF typically have header guards that start with WTF_.
-    if filename.find('/wtf/'):
+    if '/wtf/' in filename:
         special_name = "WTF_" + standard_name
     else:
         special_name = standard_name

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


--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py	2011-07-13 23:31:03 UTC (rev 90964)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py	2011-07-13 23:45:17 UTC (rev 90965)
@@ -1,7 +1,7 @@
 #!/usr/bin/python
 # -*- coding: utf-8; -*-
 #
-# Copyright (C) 2009, 2010 Google Inc. All rights reserved.
+# Copyright (C) 2011 Google Inc. All rights reserved.
 # Copyright (C) 2009 Torch Mobile Inc.
 # Copyright (C) 2009 Apple Inc. All rights reserved.
 # Copyright (C) 2010 Chris Jerdonek ([email protected])
@@ -2176,6 +2176,9 @@
                 '  [build/header_guard] [5]' % expected_guard),
             error_collector.result_list())
 
+        # Verify that we don't blindly suggest the WTF prefix for all headers.
+        self.assertFalse(expected_guard.startswith('WTF_'))
+
         # Allow the WTF_ prefix for files in that directory.
         header_guard_filter = FilterConfiguration(('-', '+build/header_guard'))
         error_collector = ErrorCollector(self.assert_, header_guard_filter)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to