Clarify the case where there is spacing before a comma/semicolon in a control condition and in functions. I would like for it to be clear if the following is wrong or right according to the coding style. for (int i = 0 ; i < 10 ; i++) doSomething(); // Qt's foreach foreach (QString &item , items) doSomething(); f(a , b);
Personally I would vote for this being discouraged by the coding style, and I have personally yet to find such code in the webkit project. What is your guys take on this?
Putting no spaces before ; and , is basically following the current project style even though it isn't in the style guide. I would likely mention it in a review.
So you think it would be OK to make a patch for the coding style guidelines? If so, I can do that.
Maybe just ask if this the current style on webkit-dev before and mention that you're willing to creating a style guide patch. That's how I saw it happen when someone else added something to the guide. This way everyone has a chance to see the style guide change. (They may not see the patch being submitted).
I agree and have send an e-mail to the discussion list.
From the mailing list: I believe it is quite well established that a space should not be allowed before a ; or , in such circumstances. (I have r-ed for it even ;) ). I think we should definitely explicitly call this out in the guidelines if it is not already. -Sam The examples in the coding style guidelines use the right style (i.e. no space before the comma or semicolon), it would be fine to make it an explicit rule. - Maciej Patch coming up!
Created attachment 33257 [details] Add explicit rule about no space before comma or semicolon
Comment on attachment 33257 [details] Add explicit rule about no space before comma or semicolon Please take out the foreach examples as that's likely to confuse people not familiar with Qt :) Otherwise, r+ following discussions on webkit-dev.
Landed in r46219