Contributing

Getting Started

Contributions are welcome! Here's how to get started:

  1. Fork the repository
  2. Clone your fork: git clone https://github.com/your-username/cargo-commitlint.git
  3. Create a feature branch: git checkout -b feature/your-feature
  4. Make your changes
  5. Run tests: cargo test
  6. Ensure code formatting: cargo fmt
  7. Check with clippy: cargo clippy
  8. Commit your changes (following Conventional Commits!)
  9. 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 clippy

Git 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 structure

Pull Request Process

  1. Ensure your code follows Rust best practices
  2. Add tests for new functionality
  3. Update documentation if needed
  4. Ensure all tests pass
  5. Ensure code is properly formatted
  6. Create a descriptive Pull Request
  7. Wait for review and address any feedback