Contributing to Exonum
Install Rust and mandatory dependencies according to our installation guide, then you can build the project and run the tests:
git clone https://github.com/exonum/exonum cd exonum cargo test --all
Finding something to fix or improve
The good first issue
Notice that the repository uses a set of linters for static analysis:
You can set up and run these tools locally (see Travis script for the details).
Generally, we follow common best practices established in the Rust community, but we have several additional conventions:
Create as minimal pull request as possible: they are easier to review and integrate.
Additionally, we merge pull requests using the "squash and merge" strategy, so feel free to merge
masterbranch in order to update instead of rebasing.
It is convenient to use
debug!when you develop some feature and are only interested in your logging output.
_in public APIs, instead use full variable names and
Public APIs should be documented, but meaningful parameter names are also helpful for better understanding.
Use Rust 2018 edition.
extern crateunless it is required.
- Use anonymous lifetime.
Prefer nested imports whenever possible.
Don't try to minimize imports scope (for example don't put it inside a function), place them at the beginning of the file.
Prefer importing a type name instead of using fully-qualified names. For example, avoid writing
std::path::Pathin code, instead import a type and use a shorter form:
// Import type: use std::path::Path; // Use it: let path = Path::new("...");
Modules and imports (
use) should be in the following order:
extern crates (if you really need them).
- Reexporting (
- Public modules (
- Imports (
- Third-party libraries.
- Standard library.
- Internal modules (