Skip to content
Permalink
Browse files
check-webkit-style: fix false-positive warnings about @synchronized
https://bugs.webkit.org/show_bug.cgi?id=156957

Reviewed by Dan Bernstein.

* Scripts/webkitpy/style/checkers/cpp.py:
(check_spacing_for_function_call): Ignore @synchronized lines.
(check_braces): Ditto.
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(CppStyleTest.test_brace_at_begin_of_line): Added a test case.


Canonical link: https://commits.webkit.org/175062@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199958 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
aestes committed Apr 24, 2016
1 parent a7df6bb commit 4dd00d8899fed2e6db7207d051f37c437b858f41
Showing with 19 additions and 2 deletions.
  1. +13 −0 Tools/ChangeLog
  2. +2 −2 Tools/Scripts/webkitpy/style/checkers/cpp.py
  3. +4 −0 Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py
@@ -1,3 +1,16 @@
2016-04-23 Andy Estes <aestes@apple.com>

check-webkit-style: fix false-positive warnings about @synchronized
https://bugs.webkit.org/show_bug.cgi?id=156957

Reviewed by Dan Bernstein.

* Scripts/webkitpy/style/checkers/cpp.py:
(check_spacing_for_function_call): Ignore @synchronized lines.
(check_braces): Ditto.
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(CppStyleTest.test_brace_at_begin_of_line): Added a test case.

2016-04-22 Srinivasan Vijayaraghavan <svijayaraghavan@apple.com>

Add JSC test results in json format to a buildbot log
@@ -1476,7 +1476,7 @@ def check_spacing_for_function_call(line, line_number, error):
error(line_number, 'whitespace/parens', 2,
'Extra space after (')
if (search(r'\w\s+\(', function_call)
and not match(r'\s*((#|typedef|@property|@interface|@implementation)|} @catch\b)', function_call)):
and not match(r'\s*((#|typedef|@property|@interface|@implementation|@synchronized)|} @catch\b)', function_call)):
error(line_number, 'whitespace/parens', 4,
'Extra space before ( in function call')
# If the ) is followed only by a newline or a { + newline, assume it's
@@ -2426,7 +2426,7 @@ def check_braces(clean_lines, line_number, error):
'This { should be at the end of the previous line')
elif (search(r'\)\s*(((const|override)\s*)*\s*)?{\s*$', line)
and line.count('(') == line.count(')')
and not search(r'(\b(if|for|while|switch|NS_ENUM)|} @catch)\b', line)
and not search(r'(\s*(if|for|while|switch|NS_ENUM|@synchronized)|} @catch)\b', line)
and not match(r'\s+[A-Z_][A-Z_0-9]+\b', line)):
error(line_number, 'whitespace/braces', 4,
'Place brace on its own line for function definitions.')
@@ -1789,6 +1789,10 @@ def test_brace_at_begin_of_line(self):
' } @catch (NSException *exception) {\n'
' }\n',
'')
self.assert_multi_line_lint(
' @synchronized (self) {\n'
' }\n',
'')

def test_mismatching_spaces_in_parens(self):
self.assert_lint('if (foo ) {', 'Extra space before ) in if'

0 comments on commit 4dd00d8

Please sign in to comment.