Bug 124731 - check-webkit-style is wrong about expected format parameter pack rvalue reference arguments
Summary: check-webkit-style is wrong about expected format parameter pack rvalue refer...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-21 11:45 PST by Brady Eidson
Modified: 2013-12-04 11:54 PST (History)
6 users (show)

See Also:


Attachments
Patch (1.70 KB, patch)
2013-11-22 02:36 PST, László Langó
no flags Details | Formatted Diff | Diff
Patch (2.48 KB, patch)
2013-11-22 02:44 PST, László Langó
no flags Details | Formatted Diff | Diff
Patch (2.30 KB, patch)
2013-11-29 00:00 PST, László Langó
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brady Eidson 2013-11-21 11:45:52 PST
check-webkit-style is wrong about expected format parameter pack rvalue reference arguments

Noticed in a patch attached to https://bugs.webkit.org/show_bug.cgi?id=124698

The complaints were:
Source/WebKit2/Shared/AsyncRequest.h:44:  Missing spaces around &&  [whitespace/operators] [3]
Source/WebKit2/Shared/AsyncRequest.h:70:  Missing spaces around &&  [whitespace/operators] [3]
Source/WebKit2/Shared/AsyncRequest.h:91:  Missing spaces around &&  [whitespace/operators] [3]

The lines in question are:
    template<typename... Arguments> void requestCompleted(Arguments&&... arguments);
    void requestCompleted(Arguments&&... arguments)
    template<typename... Arguments> void AsyncRequest::requestCompleted(Arguments&&... arguments)

The script must be detecting && as the 'boolean and' operator.  The formatting in this patch is actually correct/preferred.
Comment 1 Zan Dobersek 2013-11-21 12:58:09 PST
Bug #123406 likely covers the same issue.
Comment 2 Brady Eidson 2013-11-21 13:28:31 PST
(In reply to comment #1)
> Bug #123406 likely covers the same issue.

Hmmmm  I guess it's not out on the bot yet?
Comment 3 Csaba Osztrogonác 2013-11-21 13:36:43 PST
László fixed an rvalue related bug in bug123406. It seems 
the style checker needs a little bit more fine tuning.
Comment 4 Csaba Osztrogonác 2013-11-21 13:38:26 PST
(In reply to comment #1)
> Bug #123406 likely covers the same issue

Unortunately no, I tried the mentioned patch after the fix
for bug123406 landed, but style checker still fails on it.
Comment 5 László Langó 2013-11-21 23:13:42 PST
(In reply to comment #4)
> (In reply to comment #1)
> > Bug #123406 likely covers the same issue
> 
> Unortunately no, I tried the mentioned patch after the fix
> for bug123406 landed, but style checker still fails on it.

Yes, that was another bug, but i can check this too, if nobody works on it.
Comment 6 László Langó 2013-11-22 02:36:35 PST
Created attachment 217661 [details]
Patch
Comment 7 László Langó 2013-11-22 02:44:54 PST
Created attachment 217663 [details]
Patch
Comment 8 László Langó 2013-11-22 02:45:52 PST
I fixed this. It passed on the code you mentioned and passed on all webkitpy test, but maybe this isn't the best regexp. I don't know that is there any other tricky way to use c++11 rvaule reference.
Comment 9 Peter Gal 2013-11-28 08:13:47 PST
Comment on attachment 217663 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=217663&action=review

> Tools/Scripts/webkitpy/style/checkers/cpp.py:1848
>      if matched:
> -        error(line_number, 'whitespace/operators', 3,
> -              'Missing spaces around %s' % matched.group(1))
> +        # It is necessary to check this because rvaule references
> +        # parameter packs (c++11 feature)
> +        if not search(r'&&\.\.\.', line):

These two ifs could be merged together.
Comment 10 László Langó 2013-11-28 23:14:25 PST
(In reply to comment #9)
> (From update of attachment 217663 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=217663&action=review
> 
> > Tools/Scripts/webkitpy/style/checkers/cpp.py:1848
> >      if matched:
> > -        error(line_number, 'whitespace/operators', 3,
> > -              'Missing spaces around %s' % matched.group(1))
> > +        # It is necessary to check this because rvaule references
> > +        # parameter packs (c++11 feature)
> > +        if not search(r'&&\.\.\.', line):
> 
> These two ifs could be merged together.

You are right, we could simplify this.
Comment 11 László Langó 2013-11-29 00:00:37 PST
Created attachment 218037 [details]
Patch
Comment 12 Peter Gal 2013-12-02 01:58:16 PST
Comment on attachment 218037 [details]
Patch

cool, this looks better now :)
Comment 13 Zoltan Herczeg 2013-12-04 02:49:53 PST
Comment on attachment 218037 [details]
Patch

r=me
Comment 14 WebKit Commit Bot 2013-12-04 03:17:56 PST
Comment on attachment 218037 [details]
Patch

Clearing flags on attachment: 218037

Committed r160086: <http://trac.webkit.org/changeset/160086>
Comment 15 WebKit Commit Bot 2013-12-04 03:18:00 PST
All reviewed patches have been landed.  Closing bug.
Comment 16 Darin Adler 2013-12-04 11:54:29 PST
Comment on attachment 218037 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=218037&action=review

> Tools/Scripts/webkitpy/style/checkers/cpp.py:1845
> +    # It is necessary to check this, because rvaule references can be in

Typo here: rvaule.