If you are interested in reporting an issue, read the section "Reporting Bugs" in README.md.
This file is intended to help new developers to get started with developing Boxes.
For additional resources, visit the Boxes Developer Documentation.
- Follow our coding style.
- Include only the necessary changes in your commits.
- Read our commit message guidelines.
- Submit a merge-request.
- Tasks that are good for new contributors are marked with the "Newcomers" label.
- Building the project from the source code.
The coding style used in this project is similar to most Vala projects. In particular, the following rules are largely adapted from the Rygel Coding Style.
- 4-spaces (and not tabs) for indentation.
- 1-space between function name and braces (both calls and signature declarations).
- Prefer lines of less than <= 120 columns.
- Prefer
foreachoverfor. - Prefer descriptive names over abbreviations (unless well-known).
- Avoid the use of
thiskeyword. - Avoid unnecessary comment blocks. Favor descriptive variable and method names.
- Place each
classshould go in a separate.valafile and named according to the class in it. E.gBoxes.SpiceDisplay->spice-display.vala. - Avoid putting more than 3
usingstatements in each .vala file. If you feel you need to use more, perhaps you should consider refactoring (Move some of the code to a separate class). - If function signature/call fits in a single line, do not break it into multiple lines.
- Use
varin variable declarations wherever possible. - Use
asto cast wherever possible. - Single statements inside
if/elsemust not be enclosed by{}. - Declare the namespace of the
class/errordomainwith the class itself. For example:
private class Boxes.Hello {
...
};- Add a newline to break the code in logical pieces
- Add a newline before each
return,throw,breaketc. if it is not the only statement in that block
if (condition_applies ()) {
do_something ();
return false;
}
if (other_condition_applies ())
return true;Except for the break in a switch:
switch (val) {
case 1:
debug ("case 1");
do_one ();
break;
default:
...
}The default development branch has been renamed to main. To update
your local checkout, use:
git checkout master
git branch -m master main
git fetch
git branch --unset-upstream
git branch -u origin/main
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main