Contributing
Getting Started
Contributions are welcome! Here's how to get started:
- Fork the repository
- Clone your fork:
git clone https://github.com/your-username/cargo-commitlint.git - Create a feature branch:
git checkout -b feature/your-feature - Make your changes
- Run tests:
cargo test - Ensure code formatting:
cargo fmt - Check with clippy:
cargo clippy - Commit your changes (following Conventional Commits!)
- Push to your fork and create a Pull Request
Development Setup
Prerequisites
- Rust (latest stable version)
- Cargo
- Git
Building
# Build in debug mode
cargo build
# Build in release mode
cargo build --release
# Run tests
cargo test
# Format code
cargo fmt
# Run clippy
cargo clippyGit Hooks
This project installs its commit-msg hook through the build script into .commitlint/hooks/. Point git at it once with git config core.hooksPath .commitlint/hooks.
Available hooks:
- pre-commit: Runs cargo fmt --check and cargo clippy
- pre-push: Runs cargo test
- commit-msg: Validates commit messages using cargo-commitlint
Commit Messages
Please follow the Conventional Commits specification for all commit messages. This project uses cargo-commitlint to enforce this!
feat: add new feature
fix: resolve bug
docs: update documentation
refactor: improve code structurePull Request Process
- Ensure your code follows Rust best practices
- Add tests for new functionality
- Update documentation if needed
- Ensure all tests pass
- Ensure code is properly formatted
- Create a descriptive Pull Request
- Wait for review and address any feedback