Changeset 222937 in webkit
- Timestamp:
- Oct 5, 2017, 3:41:15 PM (8 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
Scripts/webkitpy/style/checkers/cpp.py (modified) (3 diffs)
-
Scripts/webkitpy/style/checkers/cpp_unittest.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r222918 r222937 1 2017-10-04 Megan Gardner <megan_gardner@apple.com> 2 3 check-webkit-style erroneously requires a space between the carrot and brace in obj-c blocks. 4 https://bugs.webkit.org/show_bug.cgi?id=177897 5 6 Reviewed by Dan Bernstein and Jonathan Bedard. 7 8 Remove the check for a space between ^ and {, 9 as this is valid and expected Obj-C. Now check to make sure there is 10 no space at all between ^ and {, and also that there is a space between 11 the end of an argument list and the {. 12 13 * Scripts/webkitpy/style/checkers/cpp.py: 14 (regex_for_lambdas_and_blocks): 15 1 16 2017-10-05 Carlos Garcia Campos <cgarcia@igalia.com> 2 17 -
trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py
r220896 r222937 1242 1242 def regex_for_lambdas_and_blocks(line, line_number, file_state, error): 1243 1243 cpp_result = search(r'\s\[.*?\]\s', line) 1244 objc_result = search(r'(\s\^\s?\(.*?\)\s |\^\s?\{|:\^\s?\(.*?\)\s\{)', line)1244 objc_result = search(r'(\s\^\s?\(.*?\)\s?|\^\s*\{|:\^\s?\(.*?\)\s\{)', line) 1245 1245 if cpp_result: 1246 1246 group = cpp_result.group() … … 1249 1249 if search(r'(\[\s|\s\]|\s,)', group): 1250 1250 targ_error = [line_number, 'whitespace/brackets', 4, 1251 'Extra space in capture list.' ]1251 'Extra space in capture list.',line] 1252 1252 1253 1253 if targ_error and regex_for_lambdas_and_blocks.__last_error != targ_error: … … 1262 1262 if search(r'(\(\s|\s\)|\s,)', group): 1263 1263 targ_error = [line_number, 'whitespace/brackets', 4, 1264 'Extra space in block arguments.' ]1265 if search(r'\^\ {', group):1264 'Extra space in block arguments.',line] 1265 if search(r'\^\s+\{', group): 1266 1266 targ_error = [line_number, 'whitespace/brackets', 4, 1267 ' No space between ^ and block definition.']1267 'Extra space between ^ and block definition.',line] 1268 1268 if search(r'\^\s\(', group): 1269 1269 targ_error = [line_number, 'whitespace/brackets', 4, 1270 'Extra space between ^ and block arguments.' ]1270 'Extra space between ^ and block arguments.',line] 1271 1271 1272 1272 if targ_error and regex_for_lambdas_and_blocks.__last_error != targ_error: -
trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py
r220896 r222937 1943 1943 self.assert_lint(' ^(var,var_ref) {', 'Missing space after , [whitespace/comma] [3]', 'foo.m') 1944 1944 self.assert_lint(' ^(var, var_ref) {', 'Place brace on its own line for function definitions. [whitespace/braces] [4]', 'foo.cpp') 1945 self.assert_lint(' ^ {', '', 'foo.m') 1946 self.assert_lint(' ^{', 'No space between ^ and block definition. [whitespace/brackets] [4]', 'foo.m') 1945 self.assert_lint(' ^{', '', 'foo.m') 1946 self.assert_lint(' ^ {', 'Extra space between ^ and block definition. [whitespace/brackets] [4]', 'foo.m') 1947 self.assert_lint(' ^ {', 'Extra space between ^ and block definition. [whitespace/brackets] [4]', 'foo.m') 1947 1948 self.assert_lint(' ^ (arg1, arg2) {', 'Extra space between ^ and block arguments. [whitespace/brackets] [4]', 'foo.m') 1949 self.assert_lint(' ^(arg1, arg2){', 'Missing space before { [whitespace/braces] [5]', 'foo.m') 1948 1950 1949 1951 def test_objective_c_block_as_argument(self): 1950 1952 self.assert_lint(' withLambda:^(var, var_ref) {', '', 'foo.mm') 1951 self.assert_lint(' withLambda:^ {', '', 'foo.m')1952 self.assert_lint(' withLambda:^ {', 'Nospace between ^ and block definition. [whitespace/brackets] [4]', 'foo.m')1953 self.assert_lint(' withLambda:^{', '', 'foo.m') 1954 self.assert_lint(' withLambda:^ {', 'Extra space between ^ and block definition. [whitespace/brackets] [4]', 'foo.m') 1953 1955 1954 1956 def test_spacing_around_else(self):
Note:
See TracChangeset
for help on using the changeset viewer.