|
| 1 | +# Conventional Commits Quick Reference |
| 2 | + |
| 3 | +## Commit Format |
| 4 | + |
| 5 | +``` |
| 6 | +<type>(<scope>): <subject> |
| 7 | +``` |
| 8 | + |
| 9 | +## Types |
| 10 | + |
| 11 | +| Type | Description | Version Bump | |
| 12 | +| ---------- | ----------------------- | ------------- | |
| 13 | +| `feat` | New feature | Minor (0.x.0) | |
| 14 | +| `fix` | Bug fix | Patch (0.0.x) | |
| 15 | +| `docs` | Documentation only | None | |
| 16 | +| `style` | Code style/formatting | None | |
| 17 | +| `refactor` | Code refactoring | None | |
| 18 | +| `perf` | Performance improvement | Patch | |
| 19 | +| `test` | Adding/updating tests | None | |
| 20 | +| `build` | Build system changes | None | |
| 21 | +| `ci` | CI/CD changes | None | |
| 22 | +| `chore` | Other changes | None | |
| 23 | + |
| 24 | +## Examples |
| 25 | + |
| 26 | +```bash |
| 27 | +# Feature (minor bump: 1.6.1 → 1.7.0) |
| 28 | +git commit -m "feat(models): add TabNet architecture" |
| 29 | + |
| 30 | +# Bug fix (patch bump: 1.6.1 → 1.6.2) |
| 31 | +git commit -m "fix(datamodule): resolve memory leak in batch loading" |
| 32 | + |
| 33 | +# Performance (patch bump) |
| 34 | +git commit -m "perf(transformer): optimize attention computation" |
| 35 | + |
| 36 | +# Documentation (no bump) |
| 37 | +git commit -m "docs: update API reference for MambaTab" |
| 38 | + |
| 39 | +# Breaking change (major bump: 1.6.1 → 2.0.0) |
| 40 | +git commit -m "feat!: remove Python 3.9 support |
| 41 | +
|
| 42 | +BREAKING CHANGE: Python 3.10+ is now required" |
| 43 | +``` |
| 44 | + |
| 45 | +## Scopes (Optional) |
| 46 | + |
| 47 | +Common scopes in this project: |
| 48 | + |
| 49 | +- `models`: Model implementations |
| 50 | +- `configs`: Configuration classes |
| 51 | +- `data`: Data utilities and dataloaders |
| 52 | +- `arch`: Architecture utilities |
| 53 | +- `utils`: General utilities |
| 54 | +- `ci`: CI/CD related |
| 55 | +- `deps`: Dependencies |
| 56 | + |
| 57 | +## Quick Commands |
| 58 | + |
| 59 | +```bash |
| 60 | +# Interactive commit (recommended) |
| 61 | +just commit |
| 62 | + |
| 63 | +# Version bump |
| 64 | +just bump |
| 65 | + |
| 66 | +# View changelog |
| 67 | +cat CHANGELOG.md |
| 68 | + |
| 69 | +# Dry-run semantic release |
| 70 | +just release-dry |
| 71 | +``` |
| 72 | + |
| 73 | +## Breaking Changes |
| 74 | + |
| 75 | +Use `!` after type and explain in footer: |
| 76 | + |
| 77 | +``` |
| 78 | +feat!: change API signature |
| 79 | +
|
| 80 | +BREAKING CHANGE: The `fit()` method now requires `x_train` and `y_train` as separate arguments instead of a tuple. |
| 81 | +``` |
| 82 | + |
| 83 | +## Multi-line Commits |
| 84 | + |
| 85 | +```bash |
| 86 | +# Using editor |
| 87 | +git commit |
| 88 | + |
| 89 | +# In editor: |
| 90 | +feat(models): add multi-head attention support |
| 91 | + |
| 92 | +This commit introduces multi-head attention mechanism |
| 93 | +to improve model performance on large datasets. |
| 94 | + |
| 95 | +Closes #123 |
| 96 | +``` |
| 97 | + |
| 98 | +## Pre-commit Hook |
| 99 | + |
| 100 | +Commits are validated automatically. If rejected: |
| 101 | + |
| 102 | +1. Check format: `type(scope): description` |
| 103 | +2. Use allowed types only |
| 104 | +3. Keep header under 72 characters |
| 105 | +4. Don't end subject with period |
0 commit comments