<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>27499</bug_id>
          
          <creation_ts>2009-07-21 07:40:39 -0700</creation_ts>
          <short_desc>Coding style - Clarify some cases with spacing</short_desc>
          <delta_ts>2009-07-22 07:32:28 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit Website</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Luciano Wolf">luciano.wolf</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>darin</cc>
    
    <cc>kenneth</cc>
    
    <cc>levin</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>133462</commentid>
    <comment_count>0</comment_count>
    <who name="Luciano Wolf">luciano.wolf</who>
    <bug_when>2009-07-21 07:40:39 -0700</bug_when>
    <thetext>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 &lt; 10 ; i++)
    doSomething();


// Qt&apos;s foreach
foreach (QString &amp;item , items)
    doSomething();

f(a , b);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>133626</commentid>
    <comment_count>1</comment_count>
    <who name="Kenneth Rohde Christiansen">kenneth</who>
    <bug_when>2009-07-21 15:39:28 -0700</bug_when>
    <thetext>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?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>133635</commentid>
    <comment_count>2</comment_count>
    <who name="David Levin">levin</who>
    <bug_when>2009-07-21 15:49:20 -0700</bug_when>
    <thetext>Putting no spaces before ; and , is basically following the current project style even though it isn&apos;t in the style guide.  I would likely mention it in a review.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>133636</commentid>
    <comment_count>3</comment_count>
    <who name="Kenneth Rohde Christiansen">kenneth</who>
    <bug_when>2009-07-21 15:52:19 -0700</bug_when>
    <thetext>So you think it would be OK to make a patch for the coding style guidelines? If so, I can do that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>133638</commentid>
    <comment_count>4</comment_count>
    <who name="David Levin">levin</who>
    <bug_when>2009-07-21 15:57:07 -0700</bug_when>
    <thetext>Maybe just ask if this the current style on webkit-dev before and mention that you&apos;re willing to creating a style guide patch.

That&apos;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).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>133644</commentid>
    <comment_count>5</comment_count>
    <who name="Kenneth Rohde Christiansen">kenneth</who>
    <bug_when>2009-07-21 16:06:26 -0700</bug_when>
    <thetext>I agree and have send an e-mail to the discussion list.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>133748</commentid>
    <comment_count>6</comment_count>
    <who name="Kenneth Rohde Christiansen">kenneth</who>
    <bug_when>2009-07-22 05:32:38 -0700</bug_when>
    <thetext>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!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>133749</commentid>
    <comment_count>7</comment_count>
      <attachid>33257</attachid>
    <who name="Kenneth Rohde Christiansen">kenneth</who>
    <bug_when>2009-07-22 05:39:31 -0700</bug_when>
    <thetext>Created attachment 33257
Add explicit rule about no space before comma or semicolon</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>133752</commentid>
    <comment_count>8</comment_count>
      <attachid>33257</attachid>
    <who name="Adam Treat">manyoso</who>
    <bug_when>2009-07-22 05:54:07 -0700</bug_when>
    <thetext>Comment on attachment 33257
Add explicit rule about no space before comma or semicolon

Please take out the foreach examples as that&apos;s likely to confuse people not familiar with Qt :)  Otherwise, r+ following discussions on webkit-dev.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>133753</commentid>
    <comment_count>9</comment_count>
    <who name="Kenneth Rohde Christiansen">kenneth</who>
    <bug_when>2009-07-22 06:04:59 -0700</bug_when>
    <thetext>Landed in r46219</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>33257</attachid>
            <date>2009-07-22 05:39:31 -0700</date>
            <delta_ts>2009-07-22 05:54:07 -0700</delta_ts>
            <desc>Add explicit rule about no space before comma or semicolon</desc>
            <filename>bug-27499.patch</filename>
            <type>text/plain</type>
            <size>2081</size>
            <attacher name="Kenneth Rohde Christiansen">kenneth</attacher>
            
              <data encoding="base64">RnJvbSA0YzkwNzhhZDU0NDk2MTQ1NDRlNWE1MjU1OTQ1YTY1MDkxMmIyZTZkIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBLZW5uZXRoIFJvaGRlIENocmlzdGlhbnNlbiA8a2VubmV0aEB3
ZWJraXQub3JnPgpEYXRlOiBXZWQsIDIyIEp1bCAyMDA5IDA5OjM3OjQ1IC0wMzAwClN1YmplY3Q6
IFtQQVRDSF0gMjAwOS0wNy0yMiAgS2VubmV0aCBSb2hkZSBDaHJpc3RpYW5zZW4gIDxrZW5uZXRo
QHdlYmtpdC5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yBpKyspCisgICAgZG9Tb21ldGhpbmcoKTsKKworZm9yZWFjaCAoUVN0cmlu
ZyAmaXRlbSAsIGl0ZW1zKQorICAgIGRvU29tZXRoaW5nKCk7CisKK2YoYSAsIGIpIDsKKzwvcHJl
PgorPC9saT4KKwogPGxpPlBsYWNlIHNwYWNlcyBiZXR3ZWVuIGNvbnRyb2wgc3RhdGVtZW50cyBh
bmQgdGhlaXIgcGFyZW50aGVzZXMuCiA8aDQgY2xhc3M9InJpZ2h0Ij5SaWdodDo8L2g0PgogPHBy
ZSBjbGFzcz0iY29kZSI+Ci0tIAoxLjYuMC40Cgo=
</data>
<flag name="review"
          id="17565"
          type_id="1"
          status="+"
          setter="manyoso"
    />
          </attachment>
      

    </bug>

</bugzilla>