WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
51303
check-webkit-style should detect function declarations (and trivial functions).
https://bugs.webkit.org/show_bug.cgi?id=51303
Summary
check-webkit-style should detect function declarations (and trivial functions).
David Levin
Reported
2010-12-18 23:06:02 PST
This is needed for
bug 49394
(which examines declarations).
Attachments
Patch
(8.84 KB, patch)
2010-12-18 23:49 PST
,
David Levin
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
David Levin
Comment 1
2010-12-18 23:49:10 PST
Created
attachment 76955
[details]
Patch
Shinichiro Hamaji
Comment 2
2010-12-19 12:32:14 PST
Comment on
attachment 76955
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=76955&action=review
Looks good, putting some nitpicks on test. Please feel free to ignore some of (or even all of) them if they don't make sense.
> Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py:240 > + if not function_information:
I'd add a trivial test case which passes this case. Not sure, but "if (foobar) { something... }" or "for (foobar;...) { ... }" would be good candidates?
> Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py:2818 > + self.assert_pass_ptr_check(
s/pass_ptr/pass_ref_ptr/ ?
> Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py:2823 > + self.assert_pass_ptr_check(
s/pass_ptr/pass_ref_ptr/ ?
> Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py:2837 > + ' PassRefPtr<Type1> m_other;\n'
I guess RefPtr would be more realistic?
David Levin
Comment 3
2010-12-20 11:39:01 PST
(In reply to
comment #2
)
> (From update of
attachment 76955
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=76955&action=review
> > Looks good, putting some nitpicks on test. Please feel free to ignore some of (or even all of) them if they don't make sense. > > > Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py:240 > > + if not function_information: > > I'd add a trivial test case which passes this case. Not sure, but "if (foobar) { something... }" or "for (foobar;...) { ... }" would be good candidates?
Done.
> > Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py:2818 > > + self.assert_pass_ptr_check( > > s/pass_ptr/pass_ref_ptr/ ?
I left this as is because the test is about Pass*Ptr. (It checks Pass.*Ptr so that it catches PassRefPtr and PassOwnPtr. Other things named the same way should follow the same rule.)
> > Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py:2837 > > + ' PassRefPtr<Type1> m_other;\n' > > I guess RefPtr would be more realistic?
Done. (Good point :).)
David Levin
Comment 4
2010-12-20 11:39:38 PST
Committed as
http://trac.webkit.org/changeset/74356
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug