|
| 1 | +# Conventional Commits Setup |
| 2 | + |
| 3 | +This project uses conventional commits with Husky to enforce consistent commit message formatting. |
| 4 | + |
| 5 | +## How to Commit |
| 6 | + |
| 7 | +### Option 1: Using the Interactive Commitizen Tool |
| 8 | +```bash |
| 9 | +bun run commit |
| 10 | +``` |
| 11 | +This will prompt you with questions to build a proper conventional commit message. |
| 12 | + |
| 13 | +### Option 2: Manual Commit with Conventional Format |
| 14 | +```bash |
| 15 | +git commit -m "type(scope): description" |
| 16 | +``` |
| 17 | + |
| 18 | +## Commit Types |
| 19 | + |
| 20 | +- **feat**: A new feature |
| 21 | +- **fix**: A bug fix |
| 22 | +- **docs**: Documentation only changes |
| 23 | +- **style**: Changes that do not affect the meaning of the code (white-space, formatting, etc) |
| 24 | +- **refactor**: A code change that neither fixes a bug nor adds a feature |
| 25 | +- **perf**: A code change that improves performance |
| 26 | +- **test**: Adding missing tests or correcting existing tests |
| 27 | +- **build**: Changes that affect the build system or external dependencies |
| 28 | +- **ci**: Changes to CI configuration files and scripts |
| 29 | +- **chore**: Other changes that don't modify src or test files |
| 30 | +- **revert**: Reverts a previous commit |
| 31 | + |
| 32 | +## Examples |
| 33 | + |
| 34 | +```bash |
| 35 | +feat: add snake power-ups |
| 36 | +fix: resolve collision detection bug |
| 37 | +docs: update README with new features |
| 38 | +style: format code with biome |
| 39 | +refactor: simplify game state management |
| 40 | +perf: optimize render loop |
| 41 | +test: add unit tests for game engine |
| 42 | +build: update vite configuration |
| 43 | +ci: add github action for testing |
| 44 | +chore: update dependencies |
| 45 | +``` |
| 46 | + |
| 47 | +## Automated Checks |
| 48 | + |
| 49 | +- **Pre-commit**: Runs Biome linting and formatting checks before allowing commits |
| 50 | +- **Commit-msg**: Validates commit message format using commitlint |
| 51 | + |
| 52 | +## Rules |
| 53 | + |
| 54 | +- Commit messages must follow conventional commit format |
| 55 | +- Maximum header length: 100 characters |
| 56 | +- Subject must not be empty |
| 57 | +- Subject must not end with a period |
| 58 | +- Subject must be in lowercase (except for proper nouns) |
0 commit comments