Thanks for taking the time to contribute!
The following is a set of guidelines for contributing to Locha, Turpial or .
Please read our code of conduct
ToDo
For any question you can send us a message via Twitter @Locha_io, our Telegram group t.me/Locha_io, and soon through the form you will find on our website locha.io
ToDo
ToDo
ToDo
A commit message must be short, clear and a general description of the changes or improvements. If a commit includes changes in several files or sections, we can include after the initial message a more extended description of each change.
Local header files must contain an distinctly named include guard to avoid problems with including the same header multiple times, for example:
// file: foo.h
#ifndef FOO_H
#define FOO_H
...
#endif // FOO_H
Include statements must be located at the top of the file only. By default this statement will go in the .cpp files, not in header files (.h), except when necessary and it should be sorted and grouped.
- Use a descriptive name and be consistent in style when write code
- All names should be written in English
Macros Use uppercase and underscore
#define LOW_NIBBLE(x) (x & 0xf)
Variable names Use underscore, don't group variables by types
// GOOD, underscore
int rssi_level;
int snr_level;
// BAD, Grouped
int rssi_level, snr_level;
// BAD, CamelCase
int RssiLevel;
int SnrLevel;
// BAD, mixed case
int rssiLevel;
int snrLevel;
Methods or functions Use descriptive verbs and mixed case starting with lower case.
int getTotalNearestNodes();
Classes Use CamelCase
class SomeClass {
public:
...
private:
int foo_; // Private variables ends with an underscore
};
- Always put braces around the if-else statement or when is nested in another if statement
- Put space between
if
and()
// if-else or nested if-else statements ALWAYS put braces
if (foo)
{
if(foo == 1)
{
bar = UP;
}
else
{
bar = DOWN;
}
}
else
{
bar = MIDDLE;
}
// only if statement
if (foo)
bar = UP;
- Put space between
while
and()
// while statement
while (foo > 0)
{
bar++;
}
// do-while statement
do
{
bar++;
}
while (foo > 0);
- Do not use tabs
- Use 4 spaces as default identation
ToDo