Check-webkit-style erroneously marks properly formatted lambda functions in Objective C and Objective C++ code.
Created attachment 287111 [details] Patch
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
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.
Created attachment 287116 [details] Patch
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?
Created attachment 287120 [details] Patch
(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.
Comment on attachment 287120 [details] Patch Clearing flags on attachment: 287120 Committed r205122: <http://trac.webkit.org/changeset/205122>
All reviewed patches have been landed. Closing bug.