Skip to content

Latest commit

 

History

History
108 lines (73 loc) · 1.07 KB

contribution_guide.md

File metadata and controls

108 lines (73 loc) · 1.07 KB

Contribution Guide

Environment Preparements

Compiling

  • make

Running

make join_testnet
# OR
make join_mainnet

Code Style

Introduction of dependency

correct style:

use {
    std::{env, thread, rand::random},
    clap::Arg
};

wrong style:

extern crate rand;

use std::env;
use std::thread;
use rand::random;

// avoid '*' in importing
use clap::*;

Warnings

Warnings are not allowed in any formal code; However, they are allowed in the test code.

correct style:

// lib.rs
#![deny(warnings)]

wrong style:

// any formal modular
#![allow(warnings)]

Comments & Document

correct style:

mod abc {
    //!
    //! # Modular Docs
    //!

    #![deny(missing_docs)]

    fn xxx() {}
}

wrong style:

/// # Modular Docs
mod abc {
    #![allow(missing_docs)]

    fn xxx() {}
}

The order of mod and use

correct style:

mod a;
mod b;

use std::env;

wrong style:

use std::env;

mod a;
mod b;