Self-hosted short video messaging
parco-molo docs COMMITS.md
2.5 kB · 134 lines
Markdown
at dev

Conventional Commits with convco #

This project uses Conventional Commits with convco for validation and changelog generation.

Installing convco #

With cargo:

cargo install convco

With Nix:

nix shell nixpkgs#convco

Commit Message Format #

<type>(<scope>): <subject>

[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 #

# 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:

git config commit.template .gitmessage

Then git commit will open your editor with the template.

Validating Commits #

Check if your commit message follows conventions:

convco check

Check a specific commit:

convco check <commit-hash>

Check a range:

convco check main..HEAD

Generating Changelog #

Generate/update CHANGELOG.md:

convco changelog > CHANGELOG.md

Preview unreleased changes:

convco changelog --unreleased

Version Bumping #

Determine next version based on commits:

convco version

Pre-commit Hook (Optional) #

To automatically validate commits, add to .git/hooks/commit-msg:

#!/bin/sh
convco check --from-stdin < "$1"

Make it executable:

chmod +x .git/hooks/commit-msg

Configuration #

Project configuration is in .convco file at repo root.