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:
parent
6815a0fd60
commit
1c2b271716
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user