From baddcc2f3405cf307bf3bf6be245252af74bebe7 Mon Sep 17 00:00:00 2001 From: Andy Maloney Date: Mon, 18 May 2015 09:40:40 -0400 Subject: [PATCH 1/2] - use markdown for coding convention - rewrite it --- CodeConventions.md | 31 +++++++++++++++++++++++++++++++ CodeConventions.txt | 14 -------------- 2 files changed, 31 insertions(+), 14 deletions(-) create mode 100644 CodeConventions.md delete mode 100644 CodeConventions.txt diff --git a/CodeConventions.md b/CodeConventions.md new file mode 100644 index 000000000..3f1885819 --- /dev/null +++ b/CodeConventions.md @@ -0,0 +1,31 @@ + +Open Asset Import Library Coding Conventions +== + +If you want to participate as a developer in the **Open Asset Import Library** please read and respect the following coding conventions. This will ensure consistency throughout the codebase and help all the Open Asset Import Library users. + +Spacing +== + +* No spaces between parentheses and arguments - i.e. ```foo(bar)```, not ```foo( bar )``` + +Tabs +-- + +The tab width shall be 4 spaces. Use spaces instead of tabs. + +Class/Struct Initialization +== +Constructors shall use initializer lists as follows: +```cpp +SomeClass() + : mExists(false) + , mCounter() + , mPtr() +{} +``` + +* Initializations are one-per-line +* Commas go at the beginning of the line rather than the end +* The order of the list must match the order of declaration in the class +* Any member with a default value should leave out the optional *NULL* or *0* - e.g. ```foo()```, not ```foo(NULL)``` diff --git a/CodeConventions.txt b/CodeConventions.txt deleted file mode 100644 index dcbe17ed6..000000000 --- a/CodeConventions.txt +++ /dev/null @@ -1,14 +0,0 @@ - =============================================== - The Asset-Importer-Library Coding conventions - =============================================== - - If you want to participate to the Asset-Importer_Library please have a look - onto these coding conventions and try to follow them. They are more or less - some kind of guide line to help others coming into the code and help all - the Asset-Importer-Library users. - - Tab width - =========== - The tab width shall be 4 spaces. - - \ No newline at end of file From 796289754905d53d1f4d4260e0e361070955bdd6 Mon Sep 17 00:00:00 2001 From: Andy Maloney Date: Thu, 21 May 2015 09:00:34 -0400 Subject: [PATCH 2/2] Change to what seems to be agreed upon (in line with PR #566) --- CodeConventions.md | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/CodeConventions.md b/CodeConventions.md index 3f1885819..e80e04ec4 100644 --- a/CodeConventions.md +++ b/CodeConventions.md @@ -7,25 +7,6 @@ If you want to participate as a developer in the **Open Asset Import Library** p Spacing == -* No spaces between parentheses and arguments - i.e. ```foo(bar)```, not ```foo( bar )``` - -Tabs --- - -The tab width shall be 4 spaces. Use spaces instead of tabs. - -Class/Struct Initialization -== -Constructors shall use initializer lists as follows: -```cpp -SomeClass() - : mExists(false) - , mCounter() - , mPtr() -{} -``` - -* Initializations are one-per-line -* Commas go at the beginning of the line rather than the end -* The order of the list must match the order of declaration in the class -* Any member with a default value should leave out the optional *NULL* or *0* - e.g. ```foo()```, not ```foo(NULL)``` +* Use UNIX-style line endings (LF) +* Remove any trailing whitespace +* Expand tabs to 4 spaces