Title: [128624] trunk/Tools
- Revision
- 128624
- Author
- [email protected]
- Date
- 2012-09-14 10:05:32 -0700 (Fri, 14 Sep 2012)
Log Message
check-webkit-style should not warn in case of NONCOPYABLE and FAST_ALLOCATED macros
https://bugs.webkit.org/show_bug.cgi?id=96656
Reviewed by Adam Barth.
We should allow to use WTF_MAKE_NONCOPYABLE(ClassName) and WTF_MAKE_FAST_ALLOCATED
macros in 1 line.
* Scripts/webkitpy/style/checkers/cpp.py:
(check_style.definitions):
(check_style): Add rule.
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(WebKitStyleTest.test_line_breaking): Add unittest.
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (128623 => 128624)
--- trunk/Tools/ChangeLog 2012-09-14 16:59:33 UTC (rev 128623)
+++ trunk/Tools/ChangeLog 2012-09-14 17:05:32 UTC (rev 128624)
@@ -1,3 +1,19 @@
+2012-09-14 Zoltan Horvath <[email protected]>
+
+ check-webkit-style should not warn in case of NONCOPYABLE and FAST_ALLOCATED macros
+ https://bugs.webkit.org/show_bug.cgi?id=96656
+
+ Reviewed by Adam Barth.
+
+ We should allow to use WTF_MAKE_NONCOPYABLE(ClassName) and WTF_MAKE_FAST_ALLOCATED
+ macros in 1 line.
+
+ * Scripts/webkitpy/style/checkers/cpp.py:
+ (check_style.definitions):
+ (check_style): Add rule.
+ * Scripts/webkitpy/style/checkers/cpp_unittest.py:
+ (WebKitStyleTest.test_line_breaking): Add unittest.
+
2012-09-14 Christophe Dumez <[email protected]>
WebKitTestRunner needs layoutTestController.dumpDatabaseCallbacks
Modified: trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py (128623 => 128624)
--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py 2012-09-14 16:59:33 UTC (rev 128623)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py 2012-09-14 17:05:32 UTC (rev 128624)
@@ -2567,7 +2567,10 @@
and not (match(r'.*\(.*\).*{.*.}', line)
and class_state.classinfo_stack
and line.count('{') == line.count('}'))
- and not cleansed_line.startswith('#define ')):
+ and not cleansed_line.startswith('#define ')
+ # It's ok to use use WTF_MAKE_NONCOPYABLE and WTF_MAKE_FAST_ALLOCATED macros in 1 line
+ and not (cleansed_line.find("WTF_MAKE_NONCOPYABLE") != -1
+ and cleansed_line.find("WTF_MAKE_FAST_ALLOCATED") != -1)):
error(line_number, 'whitespace/newline', 4,
'More than one command on the same line')
Modified: trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py (128623 => 128624)
--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py 2012-09-14 16:59:33 UTC (rev 128623)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py 2012-09-14 17:05:32 UTC (rev 128624)
@@ -3861,6 +3861,9 @@
# '#define TEST_ASSERT(_expression_) do { if (!(_expression_)) { TestsController::shared().testFailed(__FILE__, __LINE__, #_expression_); return; } } while (0 )\n',
# 'Mismatching spaces inside () in if [whitespace/parens] [5]')
self.assert_multi_line_lint(
+ 'WTF_MAKE_NONCOPYABLE(ClassName); WTF_MAKE_FAST_ALLOCATED;\n',
+ '')
+ self.assert_multi_line_lint(
'if (condition) {\n'
' doSomething();\n'
' doSomethingAgain();\n'
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes