Re: [webkit-dev] unwritten rules of webkit style

2009-09-03 Thread Brent Fulgham
On Sep 2, 2009, at 9:46 AM, Peter Kasting wrote: Misc Files who should end with newlines. s/who//. In fact it might be clearer to say Files should end with a trailing newline. I always follow this rule, but I don't remember why it came to exist. Is this convention needed for source

Re: [webkit-dev] unwritten rules of webkit style

2009-09-03 Thread Eric Seidel
It's a warning spit out from the compiler, diff, and other unix tools. http://stackoverflow.com/questions/72271/no-newline-at-end-of-file-compiler-warning is one explanation as to why gcc might output that warning (which turns into an error due to the mac build treaing all warnings as errors).

Re: [webkit-dev] unwritten rules of webkit style

2009-09-03 Thread Yong Li
I guess gcc complains if file doesn end with new line? -Yong - Original Message - From: Darin Adler To: Brent Fulgham Cc: WebKit Development Sent: Thursday, September 03, 2009 1:11 PM Subject: Re: [webkit-dev] unwritten rules of webkit style On Sep 2, 2009, at 11:18 PM

Re: [webkit-dev] unwritten rules of webkit style

2009-09-03 Thread Gavin Barraclough
I believe the C spec requires that files end in a newline, though I couldn't comment on the c++ spec. Possibly redundant to list this as WebKit style issue, if required by the language? G. On Sep 3, 2009, at 10:11 AM, Darin Adler wrote: On Sep 2, 2009, at 11:18 PM, Brent Fulgham wrote:

Re: [webkit-dev] unwritten rules of webkit style

2009-09-03 Thread Darin Fisher
GCC will complain (maybe only a warning?) if C++ files don't end in a newline.-Darin On Thu, Sep 3, 2009 at 1:03 PM, Gavin Barraclough barraclo...@apple.comwrote: I believe the C spec requires that files end in a newline, though I couldn't comment on the c++ spec. Possibly redundant to list

Re: [webkit-dev] unwritten rules of webkit style

2009-09-03 Thread Darin Adler
On Sep 3, 2009, at 1:03 PM, Gavin Barraclough wrote: I believe the C spec requires that files end in a newline, though I couldn't comment on the C++ spec. Possibly redundant to list this as WebKit style issue, if required by the language? This is possibly not relevant to the discussion,

Re: [webkit-dev] unwritten rules of webkit style

2009-09-02 Thread Peter Kasting
On Wed, Sep 2, 2009 at 8:40 AM, David Levin le...@chromium.org wrote: *Comments * There should be a *single* space after punctation and before the next sentence. There should only be a single space before end of line comments. I don't think either of these are unwritten rules. Both

Re: [webkit-dev] unwritten rules of webkit style

2009-09-02 Thread Peter Kasting
On Wed, Sep 2, 2009 at 9:44 AM, Adam Barth aba...@webkit.org wrote: On Wed, Sep 2, 2009 at 11:31 AM, Alexey Proskuryakova...@webkit.org wrote: As an aside, is there any practical difference between static const and const in C++? The only difference I'm aware of is that the former is

Re: [webkit-dev] unwritten rules of webkit style

2009-09-02 Thread David Levin
On Wed, Sep 2, 2009 at 9:31 AM, Alexey Proskuryakov a...@webkit.org wrote: 02.09.2009, в 8:40, David Levin написал(а): Use enums instead of bools for parameters. The one exception is function names that start with set and take one parameter (e.g. setAllowHeaders). The purpose of this rule

Re: [webkit-dev] unwritten rules of webkit style

2009-09-02 Thread Darin Adler
On Sep 2, 2009, at 9:46 AM, Peter Kasting wrote: On Wed, Sep 2, 2009 at 8:40 AM, David Levin le...@chromium.org wrote: Comments There should be a single space after punctation and before the next sentence. There should only be a single space before end of line comments. I don't think

Re: [webkit-dev] unwritten rules of webkit style

2009-09-02 Thread Geoffrey Garen
Comments should look like sentences by beginning with a capital and ending with a period (punctation). I think this is a generally good recommendation, but sometimes a sentence fragment makes for a better comment, e.g.: if (x == y) // false for NaN Don't add explicit line breaks in the

Re: [webkit-dev] unwritten rules of webkit style

2009-09-02 Thread David Levin
On Wed, Sep 2, 2009 at 11:23 AM, Geoffrey Garen gga...@apple.com wrote: Like this if (condition1 condition2) statement; I think the majority of our code disagrees with this guideline. I disagree with it too. I would prefer the to be evenly indented with condition1, or the

Re: [webkit-dev] unwritten rules of webkit style

2009-09-02 Thread David Levin
On Wed, Sep 2, 2009 at 11:54 AM, Yong Li yong...@torchmobile.com wrote: {} should be added in this case: if (condition1 condition2) statement; Not according to current WebKit style because it is a single line statement. ___

Re: [webkit-dev] unwritten rules of webkit style

2009-09-02 Thread Yong Li
(); } if (condition) { myFunction(reallyLongParam1, reallyLongParam2, ... reallyLongParam5); } - Original Message - From: David Levin To: Yong Li Cc: WebKit Development Sent: Wednesday, September 02, 2009 2:56 PM Subject: Re: [webkit-dev] unwritten rules of webkit

Re: [webkit-dev] unwritten rules of webkit style

2009-09-02 Thread Yong Li
: [webkit-dev] unwritten rules of webkit style On Wed, Sep 2, 2009 at 11:54 AM, Yong Li yong...@torchmobile.com wrote: {} should be added in this case: if (condition1 condition2) statement; Not according to current WebKit style because

Re: [webkit-dev] unwritten rules of webkit style

2009-09-02 Thread Dimitri Glazkov
    condition2) { // code... } - Original Message - From: Yong Li To: David Levin Cc: WebKit Development Sent: Wednesday, September 02, 2009 3:05 PM Subject: Re: [webkit-dev] unwritten rules of webkit style Current guideline also contains these 2 cases that {} should be used. I think

Re: [webkit-dev] unwritten rules of webkit style

2009-09-02 Thread Cameron McCormack
David Levin: In copyright entries, don't use ranges for years. Use capital (C) for the copyright and no comma after the last year. Example of a well formed copyright entry: * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. I’ve noticed a couple of different ways

Re: [webkit-dev] unwritten rules of webkit style

2009-09-02 Thread Patrick Mueller
Darin Adler wrote: On Sep 2, 2009, at 5:00 PM, Cameron McCormack wrote: I’ve noticed a couple of different ways of writing subsequent copyright lines, e.g.: Copyright (C) 2005 Somebody email 2006, 2007 Somebody Else email —

Re: [webkit-dev] unwritten rules of webkit style

2009-09-02 Thread TAMURA, Kent
{} should be added in this case: if (condition1 condition2) statement; Not according to current WebKit style because it is a single line statement. I don't like this rule. We need to be careful to add/remove a sentence in an existing block, need to guess how many