From 22ea82b80c1ac02352a1a526d6a42e70a24e0899 Mon Sep 17 00:00:00 2001 From: Don HO Date: Sat, 28 Dec 2019 10:05:19 +0500 Subject: [PATCH] Improve the format of CONTRIBUTING.md --- CONTRIBUTING.md | 55 ++++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c2095382..cf633de3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -67,10 +67,10 @@ In short: The easier the code review is, the better the chance your pull request } ``` -1. ##### Use tabs instead of white-spaces (we usually set our editors to 4 white-spaces for 1 tab, but the choice is up to you). +2. ##### Use tabs instead of white-spaces (we usually set our editors to 4 white-spaces for 1 tab, but the choice is up to you). -1. ##### Always leave one space before and after binary and ternary operators. +3. ##### Always leave one space before and after binary and ternary operators. * ###### Good: ```cpp @@ -82,7 +82,7 @@ In short: The easier the code review is, the better the chance your pull request if (a==10&&b==42) ``` -1. ##### Only leave one space after semi-colons in "for" statements. +4. ##### Only leave one space after semi-colons in "for" statements. * ###### Good: ```cpp @@ -94,8 +94,7 @@ In short: The easier the code review is, the better the chance your pull request for(int i=0;i<10;++i) ``` -1.
Keywords are not function calls;
-Function names are not separated from the first parenthesis.
+5. ##### Function names are not separated from the first parenthesis. * ###### Good: ```cpp @@ -108,7 +107,7 @@ Function names are not separated from the first parenthesis. foo (); ``` -1. ##### Keywords are separated from the first parenthesis by one space. +6. ##### Keywords are separated from the first parenthesis by one space. * ###### Good: ```cpp @@ -121,7 +120,7 @@ Function names are not separated from the first parenthesis. if(myCondition) ``` -1. ##### Use the following indenting for "switch" statements: +7. ##### Use the following indenting for "switch" statements: ```cpp switch (test) @@ -136,7 +135,7 @@ Function names are not separated from the first parenthesis. } // No semi-colon here ``` -1. ##### Avoid magic numbers. +8. ##### Avoid magic numbers. * ###### Good: ```cpp @@ -150,9 +149,9 @@ Function names are not separated from the first parenthesis. lifeTheUniverseAndEverything = buildMorePowerfulComputerForTheAnswer(); ``` -1. ##### Prefer enums for integer constants. +9. ##### Prefer enums for integer constants. -1. ##### Use initialization with curly braces. +10. ##### Use initialization with curly braces. * ###### Good: ```cpp @@ -164,7 +163,7 @@ Function names are not separated from the first parenthesis. MyClass instance(10.4); ``` -1. ##### Always use `empty()` for testing if a string is empty or not. +11. ##### Always use `empty()` for testing if a string is empty or not. * ###### Good: ```cpp @@ -179,7 +178,7 @@ Function names are not separated from the first parenthesis. ``` -1. ##### Always use `C++ conversion` instead of `C-Style cast`. Generally, all the conversion among types should be avoided. If you have no choice, use C++ conversion. +12. ##### Always use `C++ conversion` instead of `C-Style cast`. Generally, all the conversion among types should be avoided. If you have no choice, use C++ conversion. * ###### Good: ```cpp @@ -194,7 +193,7 @@ Function names are not separated from the first parenthesis. #### NAMING CONVENTIONS -1. ##### Classes (camel case) +1. ##### Classes uses Pascal Case * ###### Good: ```cpp @@ -204,21 +203,21 @@ Function names are not separated from the first parenthesis. * ###### Bad: ```cpp - class iAmClass + class iAmAClass {}; - class I_am_class + class I_am_a_class {}; ``` -1.
methods (camel case + begins with a lower case)
-method parameters (camel case + begins with a lower case)
+2. ##### Methods & method parameters use camel Case ```cpp void myMethod(uint myVeryLongParameter); ``` -1.
member variables
-Any member variable name of class/struct should be preceded by an underscore.
+3. ##### Member variables + +Any member variable name of class/struct should be preceded by an underscore. ```cpp public: @@ -228,7 +227,7 @@ Any member variable name of class/struct should be preceded by an underscore.