A template for generating generic Rust engineering projects using the cargo-generate.
- Configures
GitHub Actions
. - Uses cargo-clippy as the linter.
- Uses cargo-fmt as the code formatting tool.
- Uses
cargo test
for test. - Uses cargo-doc as the documentation generation tool.
- Uses cargo-make as the automation tool.
- Uses typos as the source code spell checker tool.
- Uses codecov as the code coverage and quality tool.
- Uses pre-commit to configure automated review scripts before
git commit
.
- Install cargo-generate.
- Use the template:
cargo generate sicheng1806/sicheng-rust-template template
your-project/
├── Cargo.toml
├── develop.md
├── LICENSE
├── Makefile.toml
├── src
│ └── main.rs
└── _typos.toml
This project requires the following tools to be installed:
- git Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
- rust with cargo A language empowering everyone to build reliable and efficient software.
- pre-commit A framework for managing and maintaining multi-language pre-commit hooks.
In addition to that, you also need to use cargo install
to install some auxiliary tools:
- cargo-make Rust task runner and build tool.
- typos Finds and corrects spelling mistakes among source code.
- Tarpaulin A code coverage reporting tool for the Cargo build system.
git init
to initial a git repository.pre-commit install
to add git hooks.
cargo check
check the code.cargo clippy
run the linter.cargo fmt
run the formatter.
or do it by cargo-make: cargo make lint
typos
to find spelling mistakes.typos -w
to fix spelling mistakes.
cargo test
to run the test.
or do it by cargo-make: cargo make test
cargo doc
to build the document.
or do it by cargo-make: cargo make docs
Modify package version value, then commit.
Add tag
git tag -a v0.1.0
Build this tag distribution package.
cargo build
or do it by cargo make: cargo make build