Bug 49427 - check-webkit-style function detection doesn't handle templates with spaces.
Summary: check-webkit-style function detection doesn't handle templates with spaces.
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: David Levin
URL:
Keywords:
Depends on:
Blocks: 49394
  Show dependency treegraph
 
Reported: 2010-11-11 22:52 PST by David Levin
Modified: 2010-11-11 23:40 PST (History)
1 user (show)

See Also:


Attachments
Patch (4.92 KB, patch)
2010-11-11 22:58 PST, David Levin
hamaji: review+
levin: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Levin 2010-11-11 22:52:10 PST
See summary.
Comment 1 David Levin 2010-11-11 22:58:16 PST
Created attachment 73702 [details]
Patch
Comment 2 Shinichiro Hamaji 2010-11-11 23:07:43 PST
Comment on attachment 73702 [details]
Patch

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

> WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py:2452
> +            ('my_namespace::my_other_namespace::MyVeryLongTypeName<Type1, Type5>*\n'

As now we can handle something like MyVeryLongTypeName<Type1, Type5<Type6, Type7> > , it's worth having such test case?
Comment 3 David Levin 2010-11-11 23:26:11 PST
Comment on attachment 73702 [details]
Patch

I'll change the test and commit.
Comment 4 David Levin 2010-11-11 23:33:40 PST
PS It found a bug.

I had to change
              line_with_no_templates = iteratively_replace_matches_with_char(r'<[^>]*>', line, "_")
to
               line_with_no_templates = iteratively_replace_matches_with_char(r'<[^<>]*>', line, "_")
in order not cover two templates at once (like this "< < >" which is what it was doing before).
Comment 5 Shinichiro Hamaji 2010-11-11 23:38:56 PST
(In reply to comment #4)
> PS It found a bug.
> 
> I had to change
>               line_with_no_templates = iteratively_replace_matches_with_char(r'<[^>]*>', line, "_")
> to
>                line_with_no_templates = iteratively_replace_matches_with_char(r'<[^<>]*>', line, "_")
> in order not cover two templates at once (like this "< < >" which is what it was doing before).

Ah, nice catch!
Comment 6 David Levin 2010-11-11 23:40:18 PST
Committed as http://trac.webkit.org/changeset/71896