Changeset 270068 in webkit
- Timestamp:
- Nov 19, 2020 9:48:42 PM (3 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r270063 r270068 1 2020-11-19 Hoa Dinh <dvh@apple.com> 2 3 check-webkit-style: requires spaces around the equal sign for Objective-C @synthesize. 4 https://bugs.webkit.org/show_bug.cgi?id=219092 5 6 Reviewed by Wenson Hsieh. 7 8 Teach the Objective-C style checker to prefer `@synthesize a = b` over `@synthesize a=b`. As a followup, 9 <webkit.org/b/219094> will apply this style rule in existing @synthesize statements in WebKit. 10 11 * Scripts/webkitpy/style/checkers/cpp.py: 12 (check_spacing): 13 * Scripts/webkitpy/style/checkers/cpp_unittest.py: 14 (CppStyleTest): 15 1 16 2020-11-19 James Darpinian <jdarpinian@chromium.org> 2 17 -
trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py
r269205 r270068 2202 2202 is_objective_c_synthesize = search(r'^@synthesize', line) 2203 2203 if is_objective_c_synthesize: 2204 # "prop=_varName" not "prop = _varName" 2205 if search(r'(\s+=|=\s+)', line): 2204 # "prop = _varName" not "prop=_varName" 2205 # We skip the check in case @synthesize is used without equal. 2206 if search(r'=', line) and not search(r'\s+=\s+', line): 2206 2207 error(line_number, 'whitespace/property', 4, 2207 'Should nothave spaces around = in property synthesis.')2208 'Should have spaces around = in property synthesis.') 2208 2209 2209 2210 # Don't try to do spacing checks for operator methods -
trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py
r267917 r270068 2106 2106 ' [whitespace/parens] [4]') 2107 2107 self.assert_lint('@property (readonly) NSUInteger count;', '') 2108 self.assert_lint('@synthesize a = b;', '') 2109 self.assert_lint('@synthesize a=b;', 'Should have spaces around = in property synthesis. [whitespace/property] [4]') 2110 self.assert_lint('@synthesize a;', '') 2108 2111 self.assert_lint('#elif (foo(bar))', '') 2109 2112 self.assert_lint('#elif (foo(bar) && foo(baz))', '')
Note: See TracChangeset
for help on using the changeset viewer.