Welcome stranger!
If you have come here to learn how to contribute to libMMU, we have some tips for you!
First of all, don't hesitate to ask questions! Use the issue tracker, no question is too simple.
todo
libMMU builds on stable Rust, if you want to build libMMU from source, here are the steps to follow:
- Navigate to the directory of your choice
- Clone this repository with git
git clone https://github.com/Memoscopy/libMMU.git
- Navigate into the newly created
libMMU
directory - Run
cargo build
The resulting library can be found in libMMU/target/debug/
.
We love code quality and Rust has some excellent tools to assist you with contributions.
Before you make your Pull Request to the project, please run it through the rustfmt
utility.
This will ensure we have good quality source code that is better for us all to maintain, following the Rust Style Guide.
rustfmt has a lot more information on the project. The quick guide is
- Install it (
rustfmt
is usually installed by default via rustup):rustup component add rustfmt
- You can now run
rustfmt
on a single file simply by...... or you can format the entire project withrustfmt src/path/to/your/file.rs
When run throughcargo fmt
cargo
it will format all bin and lib files in the current package.
For more information, such as running it from your favourite editor, please see the rustfmt
project. rustfmt
Clippy is a code analyser/linter detecting mistakes, and therefore helps to improve your code.
Like formatting your code with rustfmt
, running clippy regularly and before your Pull Request will help us maintain awesome code.
- To install
rustup component add clippy
- Running clippy
cargo clippy
Please consider the following when making a change:
-
Almost all changes that modify the Rust code must be accompanied with a test.
-
Almost all features and changes must update the documentation. See libMMU Documentation whose source is at https://github.com/Memoscopy/libMMU/tree/main/docs.
-
Almost all Rust items should be documented with doc comments. See the Rustdoc Book for more information on writing doc comments.
-
Breaking the API can only be done in major SemVer releases. These are done very infrequently, so it is preferred to avoid these when possible. See SemVer Compatibility for more information on what a SemVer breaking change is.
-
Check out the Rust API Guidelines for guidelines on designing the API.
When you feel comfortable that your changes could be integrated into libMMU, you can create a pull-request on GitHub. One of the core maintainers will then approve the changes or request some changes before it gets merged.
We use the Conventional Commits 1.0.0 specification to format our commits, pull requests and branches. This allows us to keep a good project history and simplify the making of changelogs.
That means that for our workflow, we use the following branch names :
- hotfix :
hotfix/<hotfix name>
- feature :
feat/<feature name>
- documentation :
doc/<documentation changed>
- develop :
dev/v<version number>
- ...
Instructions for libMMU maintainers to publish a new release:
- Create a PR to update the version :
- Update the version in
Cargo.toml
- Run
cargo test
to verify that everything is passing, and to updateCargo.lock
. - Double-check for any SemVer breaking changes.
Try
cargo-semver-checks
. - Commit the changes, and open a PR.
- Update the version in
- After the PR has been merged, create a release in GitHub describing the changelog.