rust-template
is a generic Rust project template designed to help developers quickly bootstrap Rust projects. It integrates various development tools and best practices to help you write, test, and maintain Rust code more efficiently.
- Pre-configured Development Environment: Includes commonly used VSCode extensions and Rust toolchain.
- Code Quality Assurance: Ensures code quality and security through tools like
pre-commit
,cargo-deny
, andtypos
. - Automated Testing: Enhanced testing with
cargo-nextest
. - Automatic Changelog Generation: Automatically generates project changelogs using
git-cliff
. - Template Generation: Quickly generate new projects using
cargo-generate
.
If you haven't installed Rust yet, you can install it using the following command:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
For the best development experience, it is recommended to install the following VSCode extensions:
- crates: Rust package management.
- Even Better TOML: TOML file support.
- Better Comments: Improved comment display.
- Error Lens: Enhanced error highlighting.
- GitLens: Git enhancements.
- Github Copilot: Code suggestions.
- indent-rainbow: Improved indentation display.
- Prettier - Code formatter: Code formatting.
- REST client: REST API debugging.
- rust-analyzer: Rust language support.
- Rust Test lens: Rust test support.
- Rust Test Explorer: Rust test overview.
- TODO Highlight: TODO highlighting.
- vscode-icons: Icon enhancements.
- YAML: YAML file support.
cargo-generate
is a tool for generating project templates. It can use an existing GitHub repository as a template to generate new projects.
cargo install cargo-generate
Generate a new project using rust-template
:
cargo generate rust-template
pre-commit
is a code linting tool that checks your code before committing.
pip install pre-commit
After installation, run the following command to enable pre-commit
:
pre-commit install
cargo-deny
is a Cargo plugin for checking dependency security.
cargo install --locked cargo-deny
typos
is a spell-checking tool.
cargo install typos-cli
git-cliff
is a tool for generating changelogs.
cargo install git-cliff
cargo-nextest
is an enhanced testing tool for Rust.
cargo install cargo-nextest --locked
Use cargo-generate
to generate a new project:
cargo generate rust-template
Run tests using cargo-nextest
:
cargo nextest run
Generate a changelog using git-cliff
:
git cliff --output CHANGELOG.md
Check dependency security using cargo-deny
:
cargo deny check
Perform spell checking using typos
:
typos
Contributions are welcome! Please read CONTRIBUTING.md to learn how to contribute to the project.
This project is licensed under the MIT License.
Happy Coding! 🚀