[Webkit-unassigned] [Bug 25884] WebKit needs a style linting tool
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Jul 7 01:51:02 PDT 2009
https://bugs.webkit.org/show_bug.cgi?id=25884
--- Comment #5 from Shinichiro Hamaji <hamaji at chromium.org> 2009-07-07 01:51:01 PDT ---
I tried to modify cpplint.py so that it could be applied for WebKit code.
Though I'm not sure if WebKit people like this, I attached a patch for
http://google-styleguide.googlecode.com/svn/trunk/cpplint/ and the results of
the lint tool for WebCore/* as an HTML to show what kind of style errors can be
detected.
If WebKit is willing to accept my patch, I'll modify the patch as a patch for
WebKitTools/Scripts and upload it. In this case, I'd like you to examine if you
like the results of the lint tool. I guess there are several errors which
WebKit developers don't care about (for example, I don't know if WebKit code
should not have trailing white spaces). If you tell me this kind of errors,
I'll remove checks for these errors.
If you want to check what kind of WebKit styles are checked, please see
testWebKitRules function in cpplint_unittest.py in my patch. Though there are
several FIXMEs, I think about half of WebKit style is covered.
As Eric mentioned, the original style isn't far different from the WebKit
style. So my change isn't so big. Here is the list of changes in my patch:
- Disable check for the order of #include (TODO: we need to support this again
using WebKit's rules)
- Allow "new (RenderArena)"
- Remove check for Google style TODO comments
- Disallow "while (something()) ;"
- Change the position of braces: for function definions brace needs its own
line
- Allow "else {" and "} else"
- Disallow 2-space indentations
- Remove check for indentations of labels (TODO: we need to support this in
WebKit's way)
- Remove check for the number of characters in a line
- Remove rules around C-style casts and sizeof
- Allow "short", "long", and "long long"
- Remove some Google specific stuff
- Remove check for variable length array
- Remove check for the style of ifndef guards
- Add unittests based on http://webkit.org/coding/coding-style.html
--
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