[Webkit-unassigned] [Bug 25884] WebKit needs a style linting tool
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Jul 8 02:53:05 PDT 2009
https://bugs.webkit.org/show_bug.cgi?id=25884
--- Comment #14 from Shinichiro Hamaji <hamaji at chromium.org> 2009-07-08 02:53:04 PDT ---
I disabled some kinds of lint errors which isn't included in WebKit's style
guide explicitly. I also modifies code so that it produces less false
positives. Now, the results become much smaller. I ran the updated script on
WebCore/rendering/* (as Eric suggested, I decreased the number of targets). It
found 69 lint errors and 3 were false positive. I think it may be acceptable
ratio as the start point. I attached a fix for the 66 errors for your
information.
The 3 false positives were related to #endif. For example, cpplint complained
the following line:
http://trac.webkit.org/browser/trunk/WebCore/rendering/bidi.cpp#L1263
For cpplint, this looks unnecessary semicolon, but it's necessary. Maybe we can
add some fixes for this kind of cases.
I think some of rules I disabled are useful though the WebKit style guide is
not saying about them explicitly. For example, I believe rules for virtual
destructor is useful. The linter warns when it finds a non virtual destructor
in a class which has virtual methods. Anyway, we can easily re-enable them by
modifying filters if we want. See UseWebKitStyles() function in cpplint.py for
the list of rules I disabled for now.
Regarding patches, now I added the support for patches. Now we can do something
like
git diff | ./cpplint.py --patch -
Most code around the patch mode has been incorporated from rietveld. As Albert
said, this patch mode may produce some flaky warnings. But I guess it would be
not so bad because cpplint doesn't see contexts so much.
As for "fix" mode, cpplint doesn't support it. And, I guess this kind of
auto-fix would introduce more troubles than benefits.
--
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