This Rust Project Template is designed to provide a comprehensive starting point for Rust-based projects. It integrates several tools and practices to ensure code quality, consistency, and security from the outset.
- Pre-Commit with Commitizen: Enforces conventional commit messages ensuring a clean and readable commit history.
- Rustfmt and Clippy: Ensures code is formatted according to Rust's standards and checks for common mistakes and improvements.
- CI with GitHub Actions: Automates building, testing, and auditing dependencies on every push or pull request.
- Dependabot Configuration: Keeps crate dependencies and GitHub Actions up-to-date with automated pull requests.
- Clone the Repository: Start by cloning this template to your local machine or use it to initialize your GitHub repository.
git clone https://github.com/donbignose/rust-project-template.git
-
Install Dependencies: Make sure you have Rust and Cargo installed. You can download them from rust-lang.org.
-
Configure Pre-Commit Hooks: This template uses pre-commit hooks managed by the
pre-commit
tool. Install it following the instructions here and set up the hooks with:
pre-commit install
- Developing: Write your Rust code in the
src/main.rs
file or create new modules as needed. - Committing Changes: Use Commitizen for commit messages. Run
git cz
instead ofgit commit
. - Testing and Linting: Run tests, format your code, and lint it using the
pre-commit hooks automatically or manually with
cargo test
,cargo fmt
, andcargo clippy
. - GitHub Actions: The
.github/workflows/ci.yml
file contains the CI configuration. It runs on every push and pull request tomain
branch.
- Commitizen: Customize commit types, scopes, etc., in the
.cz.toml
file. - GitHub Actions: Modify the CI workflow in
.github/workflows/ci.yml
as per your project's requirements. - Dependabot: Adjust the frequency and package-ecosystem in the
.github/dependabot.yml
.
Contributions to this Rust Project Template are welcome. Please ensure that your code adheres to the existing style and that all tests pass.