Bug 219092

Summary: check-webkit-style should require spaces around the equal sign for Objective-C @synthesize
Product: WebKit Reporter: Hoa Dinh <dvh>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Enhancement CC: ews-watchlist, glenn, jbedard, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Other   
OS: Other   
Bug Depends on: 219094    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Hoa Dinh
Reported 2020-11-18 09:02:06 PST
Currently, check-webkit-style will require to have no spaces around the equal sign for "@synthesize a = b". The codebase shows that "@synthesize a=b" is preferred. Let's improve check-webkit-style to match what we use.
Attachments
Patch (2.89 KB, patch)
2020-11-18 09:07 PST, Hoa Dinh
no flags
Patch (2.88 KB, patch)
2020-11-18 10:18 PST, Hoa Dinh
no flags
Patch (3.09 KB, patch)
2020-11-19 11:19 PST, Hoa Dinh
no flags
Hoa Dinh
Comment 1 2020-11-18 09:07:42 PST
Jonathan Bedard
Comment 2 2020-11-18 09:18:23 PST
Comment on attachment 414455 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=414455&action=review > Tools/ChangeLog:3 > + check-webkit-style: requires spaces around the equal sign for Should be on a single line > Tools/Scripts/webkitpy/style/checkers/cpp.py:2208 > + 'Should have spaces around = in property synthesis.') I don't have an issue with the change, but I also don't do much workin Objective-C....someone who has more experience in the area should verify this is actually what we want to do.
Wenson Hsieh
Comment 3 2020-11-18 09:45:03 PST
Comment on attachment 414455 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=414455&action=review > Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py:2109 > + self.assert_lint('@synthesize a=b;', 'Should have spaces around = in property synthesis. [whitespace/property] [4]') It looks like there are currently about 90 instances of `@synthesize foo=bar` in the WebKit stack — we should probably update these if we're changing the style rules for synthesized properties.
Wenson Hsieh
Comment 4 2020-11-18 10:06:09 PST
(In reply to Wenson Hsieh from comment #3) > Comment on attachment 414455 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=414455&action=review > > > Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py:2109 > > + self.assert_lint('@synthesize a=b;', 'Should have spaces around = in property synthesis. [whitespace/property] [4]') > > It looks like there are currently about 90 instances of `@synthesize > foo=bar` in the WebKit stack — we should probably update these if we're > changing the style rules for synthesized properties. (...but I suppose this could be done separately)
Hoa Dinh
Comment 5 2020-11-18 10:18:21 PST
Wenson Hsieh
Comment 6 2020-11-19 09:02:34 PST
Comment on attachment 414458 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=414458&action=review > Tools/ChangeLog:6 > + Reviewed by NOBODY (OOPS!). Ideally, there should be a sentence or two below the "Reviewed by" line describing the change. Maybe something like along the lines of: ``` Teach the Objective-C style checker to prefer `@synthesize a = b` over `@synthesize a=b`. As a followup, <webkit.org/b/219094> will enforce this style rule in existing @synthesize statements in WebKit. ```
Hoa Dinh
Comment 7 2020-11-19 11:19:04 PST
EWS
Comment 8 2020-11-19 21:49:04 PST
Committed r270068: <https://trac.webkit.org/changeset/270068> All reviewed patches have been landed. Closing bug and clearing flags on attachment 414603 [details].
Radar WebKit Bug Importer
Comment 9 2020-11-19 21:50:20 PST
Note You need to log in before you can comment on or make changes to this bug.