[Webkit-unassigned] [Bug 115629] check-webkit-style should allow arbitrary number indentation spaces for multi-line expressions

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 8 15:53:26 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=115629





--- Comment #3 from Darin Adler <darin at apple.com>  2013-05-08 15:51:50 PST ---
We often avoid this by not having function calls so long they have to break into multiple lines. That’s what I prefer in most cases.

This rule is relatively clear in the WebKit style guide, although it could be clearer, so it’s not an issue with the checking script but rather with the style guide. We’d want to change the style guide if had consensus that we want to change the style. There are examples of the style in the style guide itself, for example in http://www.webkit.org/coding/coding-style.html#braces-one-line there is a call to myFunction that follows the rule.

As Alexey said, the rationale for the rule is that when we change names of things, we don’t want to have to look at each replacement site and possibly reindent code.

As far as an example is concerned, I tried to think of a source file with long function call lines and went to FrameLoader.cpp and found these multi-line function calls: <http://trac.webkit.org/browser/trunk/Source/WebCore/loader/FrameLoader.cpp?rev=149589#L1212> <http://trac.webkit.org/browser/trunk/Source/WebCore/loader/FrameLoader.cpp?rev=149589#L1229> <http://trac.webkit.org/browser/trunk/Source/WebCore/loader/FrameLoader.cpp?rev=149589#L1370>. I don’t want to spend more time finding examples.

One reason at least some people like the style of lining things up with the parenthesis is because their editor does it automatically. I do think that new contributors often get this one wrong and just land what their editor does or what they are used to in other projects.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list