# Contributing Guide
Thank you for contributing. Please read the following guidelines before submitting changes.
## Development Environment
### Rust Toolchain
```bash
The project pins its Rust version in `rust-toolchain.toml`. After entering the project directory, `rustup` will automatically install the required toolchain and components when needed.
### Development Tools
```bash
cargo install --locked cargo-deny # Dependency security and license auditing
cargo install --locked typos-cli # Spell checking
cargo install --locked git-cliff # Changelog generation
cargo install --locked cargo-nextest # Enhanced test runner
pip install pre-commit # Git pre-commit checks
```
### Enable Pre-Commit
```bash
pre-commit install
```
After installation, each `git commit` will run fmt, deny, typos, check, clippy, and test checks. The commit will only succeed when all checks pass.
## Local Checks
Before submitting changes, make sure the following commands pass:
```bash
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
cargo nextest run --all-features --no-tests pass
cargo deny check
typos
```
## Commit Convention
Commit messages follow [Conventional Commits](https://www.conventionalcommits.org/):
| `feat:` | New feature |
| `fix:` | Bug fix |
| `docs:` | Documentation change |
| `refactor:` | Refactor that is neither a feature nor a bug fix |
| `perf:` | Performance improvement |
| `test:` | Test-related change |
| `chore:` | Build, toolchain, or miscellaneous maintenance |
The changelog is generated by git-cliff from commit history, so keep commit messages consistent.
## Branches And Pull Requests
- Create feature branches from `main`.
- Keep each pull request focused on a single topic.
- Pull requests must pass CI checks, including lint, test, deny, and typos.