Changeset 51587 in webkit
- Timestamp:
- Dec 1, 2009 9:51:15 PM (14 years ago)
- Location:
- trunk/WebKitSite
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitSite/ChangeLog
r51152 r51587 1 2009-12-01 Chris Jerdonek <chris.jerdonek@gmail.com> 2 3 Reviewed by Darin Adler. 4 5 Added clarifications to the web site regarding coding style and 6 code cleanup-- 7 8 https://bugs.webkit.org/show_bug.cgi?id=31618 9 10 Changes include the following: 11 12 - Expanded the style guidelines regarding "using" statements. 13 - Made the style guidelines page validate as HTML. 14 - Added that legacy WebKit components should not be cleaned up. 15 - Added that it is more acceptable to update style when already 16 touching code. 17 18 * coding/coding-style.html: 19 * coding/contributing.html: 20 * projects/cleanup/index.html: 21 1 22 2009-11-18 Eric Seidel <eric@webkit.org> 2 23 -
trunk/WebKitSite/coding/coding-style.html
r50978 r51587 1 1 <?php 2 2 $title="WebKit Coding Style Guidelines"; 3 include("../header.inc"); 4 ?> 5 3 4 $extra_head_content = <<<END 6 5 <style type="text/css"> 7 6 pre .code { … … 18 17 </style> 19 18 19 20 END; 21 22 include("../header.inc"); 23 ?> 20 24 21 25 <h2>WebKit Coding Style Guidelines</h2> … … 702 706 </ol> 703 707 704 <h3>"using namespace" Statements</h3>708 <h3>"using" Statements</h3> 705 709 706 710 <ol> 707 711 708 <li>Do not use "using namespace" statements in header files. 712 <li>In header files, do not use "using" statements in global or 713 "namespace" scope. 714 715 <h4 class="right">Right:</h4> 716 <pre class="code"> 717 // wtf/Vector.h 718 719 namespace WTF { 720 721 class VectorBuffer { 722 using std::min; 723 ... 724 }; 725 726 } // namespace WTF 727 </pre> 728 <h4 class="wrong">Wrong:</h4> 729 <pre class="code"> 730 // wtf/Vector.h 731 732 namespace WTF { 733 734 using std::min; 735 736 class VectorBuffer { 737 ... 738 }; 739 740 } // namespace WTF 741 </pre> 742 </li> 743 744 <li>It is acceptable, however, to use "using" declarations at the end of 745 header files in the WTF sub-libary to include one or more names in 746 the WTF namespace into the global scope. 747 748 <h4 class="right">Right:</h4> 749 <pre class="code"> 750 // wtf/Vector.h 751 752 namespace WTF { 753 754 } // namespace WTF 755 756 using WTF::Vector; 757 </pre> 758 <h4 class="wrong">Wrong:</h4> 759 <pre class="code"> 760 // wtf/Vector.h 761 762 namespace WTF { 763 764 } // namespace WTF 765 766 using namespace WTF; 767 </pre> 768 <h4 class="wrong">Wrong:</h4> 769 <pre class="code"> 770 // runtime/UString.h 771 772 namespace WTF { 773 774 } // namespace WTF 775 776 using WTF::PlacementNewAdopt; 777 </pre> 709 778 </li> 710 779 -
trunk/WebKitSite/coding/contributing.html
r49606 r51587 21 21 22 22 <h3>Code Style Guidelines</h3> 23 <p>In order for your patch to be landed, it's necessary that it comply to the <a href="/coding/coding-style.html">code style guidelines</a>. 24 There are some older parts of the codebase that do not always follow these guidelines. If you come across code like this, 25 it's generally best to clean it up to comply with the new guidelines.</p> 23 <p>Patches must comply with the <a href="/coding/coding-style.html">code style guidelines</a>. 24 Some older parts of the codebase do not follow these guidelines. 25 If you are modifying such code, it is generally best to clean it up 26 to comply with the current guidelines. An exception is legacy components, 27 which should not be cleaned up.</p> 26 28 27 29 <h3>Regression tests</h3> -
trunk/WebKitSite/projects/cleanup/index.html
r16492 r51587 17 17 <dt>Follow the Coding Style Guidelines</dt> 18 18 <dd>We welcome patches that clean up code to follow our coding style guidelines. 19 We especially encourage contributors to clean up code that they are already 20 working on. It is less common for contributors to update style without 21 making substantive changes. If you would like to clean up code without 22 making substantive changes, you are advised to check with project members 23 first.</dd> 19 24 20 25 <dt>Eliminate Redundant Code in WebKit and WebCore</dt>
Note: See TracChangeset
for help on using the changeset viewer.