Bug 27377 - Assorted cpplint improvements
Summary: Assorted cpplint improvements
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-17 10:12 PDT by Adam Treat
Modified: 2009-07-17 13:14 PDT (History)
0 users

See Also:


Attachments
Adds new cpplint check for webkit rule violation (3.39 KB, patch)
2009-07-17 10:27 PDT, Adam Treat
levin: review+
Details | Formatted Diff | Diff
Turn off erroneous filters preventing valid checks (1.66 KB, patch)
2009-07-17 10:28 PDT, Adam Treat
levin: review+
Details | Formatted Diff | Diff
Move comment to where it belongs (1.82 KB, patch)
2009-07-17 10:28 PDT, Adam Treat
levin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Treat 2009-07-17 10:12:35 PDT
The following patches are for assorted improvements in cpplint.  The ChangeLog describes them.
Comment 1 Adam Treat 2009-07-17 10:27:34 PDT
Created attachment 32953 [details]
Adds new cpplint check for webkit rule violation
Comment 2 Adam Treat 2009-07-17 10:28:10 PDT
Created attachment 32954 [details]
Turn off erroneous filters preventing valid checks
Comment 3 Adam Treat 2009-07-17 10:28:34 PDT
Created attachment 32955 [details]
Move comment to where it belongs
Comment 4 David Levin 2009-07-17 12:09:52 PDT
Comment on attachment 32954 [details]
Turn off erroneous filters preventing valid checks

> diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
> index 7b66d46..80f3a75 100644
> --- a/WebKitTools/ChangeLog
> +++ b/WebKitTools/ChangeLog
> @@ -3,6 +3,29 @@
>          Reviewed by NOBODY (OOPS!).
>  
>          https://bugs.webkit.org/show_bug.cgi?id=27377
> +        Don't filter whitespace at the end of the line.  This is not
> +        explicitly a rule of webkit coding style, but there is no reason
> +        not to warn of this common style problem.
> +
> +        Don't filter whitespace newline.  This prevents cpplint of complaining
> +        about the following situation:

I was confused when I read this because it sounded like removing the filtering prevented the complaining.

Here's an idea for an alternate wording:
        Don't filter whitespace newline.  Now, cpplint will complain
        about the following situation:


> +
> +            if (true) {
> +                doSomething();
> +                doSomethingAgain();
> +            }
> +            else
> +                doSomething();
> +
> +        Which is a webkit coding style rule violation.
> +
> +        * Scripts/modules/cpplint.py:
> +
> +2009-07-17  Adam Treat  <adam.treat@torchmobile.com>
> +
> +        Reviewed by NOBODY (OOPS!).
> +
> +        https://bugs.webkit.org/show_bug.cgi?id=27377
>          This makes cpplint complain about this for instance:
>  
>              if (true)
> diff --git a/WebKitTools/Scripts/modules/cpplint.py b/WebKitTools/Scripts/modules/cpplint.py
> index 2ef4e3a..cf22e3d 100644
> --- a/WebKitTools/Scripts/modules/cpplint.py
> +++ b/WebKitTools/Scripts/modules/cpplint.py
> @@ -2786,10 +2786,8 @@ def use_webkit_styles():
>      #        modify the implementation and enable them.
>      global _DEFAULT_FILTERS
>      _DEFAULT_FILTERS = [
> -        '-whitespace/end_of_line',
>          '-whitespace/comments',
>          '-whitespace/blank_line',
> -        '-whitespace/newline',  # '\r'
>          '-runtime/explicit',  # explicit
>          '-runtime/virtual',  # virtual dtor
>          '-runtime/printf',
Comment 5 David Levin 2009-07-17 12:30:38 PDT
Comment on attachment 32953 [details]
Adds new cpplint check for webkit rule violation


> +             or search(r'\b(if|for|while|switch)\b', previous_line))
Please add "else" and a test case using else.
Comment 6 Adam Treat 2009-07-17 13:14:54 PDT
Landed with r46051, r46052, and r46053.