[Webkit-unassigned] [Bug 27354] cpplint should check for one line control statements surrounded by braces

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jul 16 17:21:02 PDT 2009


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


David Levin <levin at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #32902|review?                     |review+
               Flag|                            |




--- Comment #4 from David Levin <levin at chromium.org>  2009-07-16 17:21:01 PDT ---
(From update of attachment 32902)

> diff --git a/WebKitTools/Scripts/modules/cpplint.py b/WebKitTools/Scripts/modules/cpplint.py
> +    if (match(r'\s*}\s*$', line)
> +        and line_number > 1):

You might as well put this on one line.  In general, feel free to make the
lines as long as you wish.  (Most of the code was developed using 80 characters
limits so sometimes it seems to do weird line wrappings to meet this
requirement.)


> +        # We check if a closed brace has started a line to see if a
> +        # one line control statement was previous

Nice to add a "." to the end of your sentence.

> +        previous_line = clean_lines.elided[line_number - 2]
> +        if (previous_line.find('{') > 0
> +            and search(r'\b(if|for|while|else)\b', previous_line)):
> +            error(filename, line_number, 'whitespace/braces', 4,
> +                  'One line control clauses should not use braces')

Nice to add a "." to the end of your sentence.

-- 
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