RESOLVED FIXED Bug 28370
check-webkit-style: add check for 'using std::foo;' statements
https://bugs.webkit.org/show_bug.cgi?id=28370
Summary check-webkit-style: add check for 'using std::foo;' statements
David Kilzer (:ddkilzer)
Reported 2009-08-16 15:35:54 PDT
Created attachment 34940 [details] Patch v1 Reviewed by NOBODY (OOPS!). In <http://webkit.org/b/28355#c1>, it was noted that new source files use 'using namespace std;' instead of individual 'use std::foo;' statements. This adds a level 4 check for such statements. * Scripts/modules/cpp_style.py: (_ERROR_CATEGORIES): Added 'build/using_std'. (check_using_std): Added. (check_style): Added call to check_using_std(). * Scripts/modules/cpp_style_unittest.py: (WebKitStyleTest.test_using_std): Added unit test. --- 3 files changed, 54 insertions(+), 0 deletions(-)
Attachments
Patch v1 (4.35 KB, patch)
2009-08-16 15:35 PDT, David Kilzer (:ddkilzer)
levin: review+
David Kilzer (:ddkilzer)
Comment 1 2009-08-16 15:52:37 PDT
(In reply to comment #0) > In <http://webkit.org/b/28355#c1>, it was noted that new source > files use 'using namespace std;' instead of individual > 'use std::foo;' statements. This adds a level 4 check for such > statements. That should be 'using std::foo;' in the ChangeLog comment. Already fixed locally.
David Levin
Comment 2 2009-08-16 16:31:22 PDT
Comment on attachment 34940 [details] Patch v1 > + 'Use \'using namespace std;\' instead of \'using std::%s;\'.' % method_name) Consider using "" for the outer quotes to avoid the \' because it makes it easier to read. Like this: "Use 'using namespace std;' instead of 'using std::%s;'." % method_name) > diff --git a/WebKitTools/Scripts/modules/cpp_style_unittest.py b/WebKitTools/Scripts/modules/cpp_style_unittest.py > + 'Use \'using namespace std;\' instead of \'using std::min;\'.' Consider using "" for the outer quotes to avoid the \'.
David Kilzer (:ddkilzer)
Comment 3 2009-08-16 17:45:03 PDT
Committing to http://svn.webkit.org/repository/webkit/trunk ... M WebKitTools/ChangeLog M WebKitTools/Scripts/modules/cpp_style.py M WebKitTools/Scripts/modules/cpp_style_unittest.py Committed r47346 M WebKitTools/ChangeLog M WebKitTools/Scripts/modules/cpp_style_unittest.py M WebKitTools/Scripts/modules/cpp_style.py r47346 = b78d6ef8825272cc9ccf21957ae16d96d64080c7 (trunk) No changes between current HEAD and refs/remotes/trunk Resetting to the latest refs/remotes/trunk http://trac.webkit.org/changeset/47346
David Kilzer (:ddkilzer)
Comment 4 2009-08-16 17:45:08 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.