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 testfor 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 templateyour-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 initto initial a git repository.pre-commit installto add git hooks.
cargo checkcheck the code.cargo clippyrun the linter.cargo fmtrun the formatter.
or do it by cargo-make: cargo make lint
typosto find spelling mistakes.typos -wto fix spelling mistakes.
cargo testto run the test.
or do it by cargo-make: cargo make test
cargo docto 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.0Build this tag distribution package.
cargo buildor do it by cargo make: cargo make build