1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

docs(CONTRIBUTING): change style to always require curly brackets

RE: #3601
This commit is contained in:
Zetok Zalbavar 2016-10-22 21:39:40 +01:00
parent 6815a0fd60
commit 1c2b271716
No known key found for this signature in database
GPG Key ID: C953D3880212068A

View File

@ -327,27 +327,18 @@ function()
} }
// if / while / for / switch // if / while / for / switch
if () // always use curly brackets
1_line; if () // ← note the space between `if` and parenthesis
{
1_line_curly;
}
else if () else if ()
{
just_one_line; just_one_line;
else
each_condition;
// ↑ note space between last line of conditional code, and code outside of condition
if ()
{
1_line;
}
else if ()
{
what_if;
i_told_you;
} }
else else
{ {
that_there_are; each_condition_in_curly;
more_lines;
} }
QObject* asterisksGoWithTheType; QObject* asterisksGoWithTheType;
@ -357,7 +348,6 @@ uint8_t* array = new uint8_t[count];
QObject notToMentionThatWeUseCamelCase; QObject notToMentionThatWeUseCamelCase;
``` ```
E.g. https://github.com/qTox/qTox/blob/master/src/misc/flowlayout.cpp
## Dynamic casts / RTTI ## Dynamic casts / RTTI