|
| 1 | +Writing Code for Cerberus |
| 2 | +========================= |
| 3 | + |
| 4 | +## Code Style ## |
| 5 | + |
| 6 | +Rust does not have an offical code style guide. We will use the style guide currently in the rust-lang-nursery. |
| 7 | +This style guide can be found [here](https://github.com/rust-lang-nursery/fmt-rfcs/blob/master/guide/guide.md). |
| 8 | + |
| 9 | +## Code Formatting ## |
| 10 | + |
| 11 | +All `rust` code checked into the repository must be formatted according to `rustfmt`. |
| 12 | + |
| 13 | +## Commenting ## |
| 14 | + |
| 15 | +Commenting will be done in accordance with the standard `rustdoc` style used for generating documentation. |
| 16 | +You should write comments to explain any code you write that does something in a way that may not be obvious. |
| 17 | +An explaination of standard Rust commenting practice and `rustdoc` can be found [here](https://doc.rust-lang.org/book/first-edition/documentation.html). |
| 18 | + |
| 19 | +## Automated Testing ## |
| 20 | + |
| 21 | +Automated unit/integration tests should be written using the rust testing framework. |
| 22 | +Tests will be automatically ran for each pull request and pull requests with failling tests will not be merged. |
| 23 | + |
| 24 | +## Branching ## |
| 25 | + |
| 26 | +Branching should be done in accordance with the [git-flow](http://nvie.com/posts/a-successful-git-branching-model/) style of branching. |
| 27 | +There is a master branch and a develop branch. All features will be developed in feature branches off the develop branch. |
| 28 | +Features will be merged into the develop branch when complete. |
| 29 | +A release branch will be branched from the develop branch for final bugfixes before a release. When ready for a release it will be merged to the master branch. |
| 30 | + |
| 31 | +## Merging ## |
| 32 | +Before merging a branch into develop, all commits should be sqaushed to keep the history clean. |
| 33 | +This should be done locally as the squash feature on github uses a fast forward merge. |
| 34 | + |
| 35 | +## Version Numbering ## |
| 36 | + |
| 37 | +We will be using [semantic versioning](http://semver.org/). Every binary will have a separate |
| 38 | +version number (server, client, etc.). This will begin at 0.1.0 and will be incremented strictly |
| 39 | +according to the semantic versioning guidelines. |
| 40 | + |
| 41 | +## Code Review ## |
| 42 | + |
| 43 | +All code must be submitted via pull requests, *not* checked straight into the repo. |
| 44 | +A pull request will be from a single feature branch, which will not be used for any other |
| 45 | +features after merging. Ideally, it will be deleted after a merge. |
| 46 | + |
| 47 | +All pull requests must be reviewed by at least two people who are not the submitter. You can |
| 48 | +ask in Slack for a review, or use Github's assign feature to assign the pull request to a |
| 49 | +specific person. |
0 commit comments