RESOLVED FIXED161247
Check-webkit-style does not work with Objective-C blocks
https://bugs.webkit.org/show_bug.cgi?id=161247
Summary Check-webkit-style does not work with Objective-C blocks
Jonathan Bedard
Reported 2016-08-26 09:09:22 PDT
Check-webkit-style erroneously marks properly formatted lambda functions in Objective C and Objective C++ code.
Attachments
Patch (8.73 KB, patch)
2016-08-26 09:16 PDT, Jonathan Bedard
no flags
Patch (9.38 KB, patch)
2016-08-26 10:04 PDT, Jonathan Bedard
no flags
Patch (9.77 KB, patch)
2016-08-26 10:41 PDT, Jonathan Bedard
no flags
Jonathan Bedard
Comment 1 2016-08-26 09:16:10 PDT
Alexey Proskuryakov
Comment 2 2016-08-26 09:18:08 PDT
Comment on attachment 287111 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=287111&action=review > Tools/ChangeLog:3 > + Check-webkit-style does not work with Lambda functions in Objective C The official name for these is "block". https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/WorkingwithBlocks/WorkingwithBlocks.html
Jonathan Bedard
Comment 3 2016-08-26 09:19:45 PDT
Comment on attachment 287111 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=287111&action=review >> Tools/ChangeLog:3 >> + Check-webkit-style does not work with Lambda functions in Objective C > > The official name for these is "block". > > https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/WorkingwithBlocks/WorkingwithBlocks.html Good to know. This patch needs updating then.
Jonathan Bedard
Comment 4 2016-08-26 10:04:34 PDT
Jonathan Bedard
Comment 5 2016-08-26 10:13:22 PDT
This patch makes a best attempt to enforce WebKit style guidelines on Objective C blocks. The trouble is that our style guidelines do not explicitly cover Objective C blocks, a few examples: This would seem to be consistent with our handling of spaces before brackets: ^ {... This would seem to be consistent with our handling of function declarations: ^(int arg1, int arg2) {... The above examples follow the rules implemented by this patch, so all of the following are illegal: ^{... ^ (int arg1, int arg2) {... ^(int arg1, int arg2){... Should we document these style guidelines explicitly, or just allow check-webkit-style to enforce them?
Jonathan Bedard
Comment 6 2016-08-26 10:41:19 PDT
Brady Eidson
Comment 7 2016-08-27 22:04:20 PDT
(In reply to comment #5) > This patch makes a best attempt to enforce WebKit style guidelines on > Objective C blocks. The trouble is that our style guidelines do not > explicitly cover Objective C blocks, a few examples: > > This would seem to be consistent with our handling of spaces before brackets: > ^ {... > This would seem to be consistent with our handling of function declarations: > ^(int arg1, int arg2) {... > > The above examples follow the rules implemented by this patch, so all of the > following are illegal: > ^{... > ^ (int arg1, int arg2) {... > ^(int arg1, int arg2){... > > Should we document these style guidelines explicitly, or just allow > check-webkit-style to enforce them? We should document them as well, but doing so should not hold up this patch; It's okay for check-webkit-style to catch them before they're documented.
WebKit Commit Bot
Comment 8 2016-08-29 09:20:54 PDT
Comment on attachment 287120 [details] Patch Clearing flags on attachment: 287120 Committed r205122: <http://trac.webkit.org/changeset/205122>
WebKit Commit Bot
Comment 9 2016-08-29 09:21:08 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.