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 | shFor 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-generateGenerate a new project using rust-template:
cargo generate rust-templatepre-commit is a code linting tool that checks your code before committing.
pip install pre-commitAfter installation, run the following command to enable pre-commit:
pre-commit installcargo-deny is a Cargo plugin for checking dependency security.
cargo install --locked cargo-denytypos is a spell-checking tool.
cargo install typos-cligit-cliff is a tool for generating changelogs.
cargo install git-cliffcargo-nextest is an enhanced testing tool for Rust.
cargo install cargo-nextest --lockedUse cargo-generate to generate a new project:
cargo generate rust-templateRun tests using cargo-nextest:
cargo nextest runGenerate a changelog using git-cliff:
git cliff --output CHANGELOG.mdCheck dependency security using cargo-deny:
cargo deny checkPerform spell checking using typos:
typosContributions are welcome! Please read CONTRIBUTING.md to learn how to contribute to the project.
This project is licensed under the MIT License.
Happy Coding! 🚀