Skip to content
Snippets Groups Projects
Commit ed578b79 authored by nanocryk's avatar nanocryk
Browse files

[enh] Detailed workflow

parent f0752708
Branches
Tags
1 merge request!12Resolve "Write contributing doc"
...@@ -7,14 +7,79 @@ Please note we have a specific workflow, please follow it in all your interactio ...@@ -7,14 +7,79 @@ Please note we have a specific workflow, please follow it in all your interactio
## Workflow ## Workflow
1. You must create a different issue for each feature you wish to develop, assign this issue yourself, then on the issue page click on the button "create a merge request". - You must create an issue for each feature you wish to develop, with a precise title and a
2. Gitlab will then create a branch dedicated to the issue as well as a MR in the WIP state that will merge this branch into the default branch (dev). description of your feature. Then, assign it to yourself and click on the button
3. Please specify the crate concerned in the issue labels. **`Create a merge request`**. GitLab will create a branch dedicated to the issue as well as a
4. Never contribute to a branch whose issue has not been assigned to you! the contributor can make a git rebase at any time and your commit would be lost ! *Work in Progress* merge request of this branch into the main branch (`dev`).
5. Before you pusher your commit: - Please use tags to specify feature domains and concerned crates.
a. Apply fmt (gitlab-ci will make sure it is ok!) - Never contribute to a branch whose issue has not been assigned to you! If the contributor make a
b. Verify that ALL tests always pass. `git rebase` your commit will be lost !
c. Made a git rebase to make your history clean. - Before you push your commit:
1. Apply `rustfmt`. Only formatted code will be accepted, and gitlab-ci will make sure it is ok.
Some exceptions are accepted such as long raw strings.
`rustfmt` is a tool applying Rust idiomatic code style to your files automatically.
If you're using rust 1.24 or greater :
```bash
# Install rustfmt through rustup
rustup component add rustfmt
# Run rustfmt
cargo fmt
```
If you're using rust 1.23 or lower :
```bash
# Install nightly toolchain
rustup install nightly
# Install rustfmt through cargo
cargo +nightly install rustfmt
# Run rustfmt
cargo +nightly fmt
```
> If you switch from 1.23 to 1.24, uninstall `rustfmt` from cargo and install it back with
> `rustup`
1. Use `clippy`.
`clippy` is a linting tool scanning your code to find common mistakes or bad code.
Currenctly `clippy` is only available on the `nigthly` toolchain.
```bash
# Install nightly toolchain
rustup install nightly
# Install clippy through cargo
cargo +nightly install clippy
# Run clippy
cargo +nightly clippy
```
1. Document your code and avoid any unsafe feature.
Each create should contain in its root file
```rust
#![deny(missing_docs, missing_debug_implementations, missing_copy_implementations,
trivial_casts, trivial_numeric_casts, unsafe_code, unstable_features, unused_import_braces,
unused_qualifications)]
```
It forces you to write documentation for any public code and prevent you from using unstable
or unsafe code.
1. Write unit tests, and verify that they **all** pass.
1. Made a git rebase to make your history clean.
```bash
# Make an alias
git config --global alias.tidy "rebase -i @{upstream}"
# Rebase your last commits since last push
git tidy
```
## Merge Process ## Merge Process
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment