Bug 32301

Summary: Add "using std::foo" rule checked by script to coding style guidelines
Product: WebKit Reporter: Chris Jerdonek <cjerdonek>
Component: WebKit WebsiteAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Minor CC: cjerdonek, commit-queue, webkit.review.bot
Priority: P4    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
URL: https://lists.webkit.org/pipermail/webkit-dev/2009-December/010906.html
Attachments:
Description Flags
Proposed patch
darin: review+
Revised patch none

Description Chris Jerdonek 2009-12-08 19:40:36 PST
This is a bug report to make the following changes and clarifications to the coding style guidelines:

(1) Add this to the guidelines: Do not use statements of the form
"using std:foo" in implementation files.  Use "using namespace std"
instead.  (The script currently enforces this rule, but for header
files and not just implementation files.)

(2) Clarify that the rule to put "using namespace" statements near the
beginning of a file applies only to implementation files. (It
currently applies also to header files.)  Also, strengthen the rule so
it applies to all "using" statements in implementation files and not
just "using namespace" statements.

(The above is excerpted from an e-mail to the webkit-dev list -- linked to by the URL for this report.)
Comment 1 Chris Jerdonek 2009-12-08 20:00:36 PST
Created attachment 44509 [details]
Proposed patch

Changes made as reported.

Also, all the "using" statement style guidelines now lead with "In header files" or "In implementation files," etc. so it is immediately obvious what types of files each rule applies to.
Comment 2 WebKit Review Bot 2009-12-08 20:05:20 PST
style-queue ran check-webkit-style on attachment 44509 [details] without any errors.
Comment 3 Darin Adler 2009-12-09 09:31:44 PST
Comment on attachment 44509 [details]
Proposed patch

> +<li>In header files in the WTF sub-library, however, it is acceptable
> +to use "using" declarations at the end of the file to include one
> +or more names in the WTF namespace into the global scope.

I think the use of the verb "include" here is strange. I think it should be "add" or "import" instead.
Comment 4 Chris Jerdonek 2009-12-09 10:16:38 PST
Created attachment 44543 [details]
Revised patch

Changed the two uses of "include" to "import" -- as suggested.
Comment 5 WebKit Review Bot 2009-12-09 10:19:49 PST
style-queue ran check-webkit-style on attachment 44543 [details] without any errors.
Comment 6 WebKit Commit Bot 2009-12-09 15:08:55 PST
Comment on attachment 44543 [details]
Revised patch

Clearing flags on attachment: 44543

Committed r51929: <http://trac.webkit.org/changeset/51929>
Comment 7 WebKit Commit Bot 2009-12-09 15:09:01 PST
All reviewed patches have been landed.  Closing bug.