# Conventional Commits with convco This project uses [Conventional Commits](https://www.conventionalcommits.org/) with [convco](https://github.com/convco/convco) for validation and changelog generation. ## Installing convco **With cargo:** ```bash cargo install convco ``` **With Nix:** ```bash nix shell nixpkgs#convco ``` ## Commit Message Format ``` (): [optional body] [optional footer] ``` ### Types - `feat` - New feature (triggers minor version bump) - `fix` - Bug fix (triggers patch version bump) - `docs` - Documentation only - `style` - Code style/formatting (no logic change) - `refactor` - Code refactoring - `perf` - Performance improvement - `test` - Adding or updating tests - `chore` - Maintenance (dependencies, build config) - `ci` - CI/CD changes ### Scopes Common scopes for this project: - `auth` - Authentication/authorization - `video` - Video processing/playback - `api` - API endpoints - `db` - Database/migrations - `frontend` - Client-side code - `backend` - Server-side code - `config` - Configuration - `storage` - File storage - `upload` - Video upload - `stream` - Video streaming ### Examples ```bash # Simple commit git commit -m "chore: initialize Rust backend" # With scope git commit -m "feat(auth): add JWT token generation" # With body git commit -m "fix(upload): handle large file validation Properly validate file size before accepting uploads to prevent out-of-memory errors." # Breaking change git commit -m "feat(api)!: change authentication flow BREAKING CHANGE: JWT tokens now require user_id claim" ``` ## Using the Template Set up git to use the commit template: ```bash git config commit.template .gitmessage ``` Then `git commit` will open your editor with the template. ## Validating Commits Check if your commit message follows conventions: ```bash convco check ``` Check a specific commit: ```bash convco check ``` Check a range: ```bash convco check main..HEAD ``` ## Generating Changelog Generate/update CHANGELOG.md: ```bash convco changelog > CHANGELOG.md ``` Preview unreleased changes: ```bash convco changelog --unreleased ``` ## Version Bumping Determine next version based on commits: ```bash convco version ``` ## Pre-commit Hook (Optional) To automatically validate commits, add to `.git/hooks/commit-msg`: ```bash #!/bin/sh convco check --from-stdin < "$1" ``` Make it executable: ```bash chmod +x .git/hooks/commit-msg ``` ## Configuration Project configuration is in `.convco` file at repo root.