Commit a0d0994d authored by zoltan@webkit.org's avatar zoltan@webkit.org
Browse files

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.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128624 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 4c837870
2012-09-14 Zoltan Horvath <zoltan@webkit.org>
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 <christophe.dumez@intel.com>
 
WebKitTestRunner needs layoutTestController.dumpDatabaseCallbacks
......
......@@ -2567,7 +2567,10 @@ def check_style(clean_lines, line_number, file_extension, class_state, file_stat
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')
......
......@@ -3860,6 +3860,9 @@ class WebKitStyleTest(CppStyleTestBase):
# self.assert_multi_line_lint(
# '#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'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment