|
| 1 | +# 📝 Commit Message Guidelines |
| 2 | + |
| 3 | +## Purpose |
| 4 | + |
| 5 | +To maintain a clean, readable, and automated commit history, we enforce the [Conventional Commits ↗](https://www.conventionalcommits.org/en/v1.0.0/) specification across this repository. |
| 6 | + |
| 7 | +All commits **must** follow the format described below. Commits that do not comply will be automatically rejected by our Git hooks. |
| 8 | + |
| 9 | +--- |
| 10 | + |
| 11 | +## 📋 Commit Format |
| 12 | + |
| 13 | +``` |
| 14 | +<type>(<scope>): <subject> |
| 15 | +``` |
| 16 | + |
| 17 | +- `type`: the kind of change you're committing. |
| 18 | +- `scope`: the specific part of the codebase affected (optional but encouraged). |
| 19 | +- `subject`: a brief description of the change. |
| 20 | + |
| 21 | +--- |
| 22 | +## ✏️ Examples |
| 23 | + |
| 24 | +Good examples: |
| 25 | +``` |
| 26 | +feat(core): add authentication module |
| 27 | +fix(openSCD): resolve login redirect bug |
| 28 | +docs: update contributing guidelines |
| 29 | +chore: update eslint config |
| 30 | +``` |
| 31 | + |
| 32 | +Bad examples (these would be rejected): |
| 33 | +``` |
| 34 | +"fix bug" |
| 35 | +"updated stuff" |
| 36 | +"small changes" |
| 37 | +``` |
| 38 | + |
| 39 | +--- |
| 40 | +## 🔖 Some of the allowed Types |
| 41 | + |
| 42 | +⚠️ Disclaimer: For a full list please visit the [conventional commits ↗](https://www.conventionalcommits.org/en/v1.0.0/) page |
| 43 | + |
| 44 | +| Type | Purpose | |
| 45 | +|------------|-----------------------------------------------------------| |
| 46 | +| feat | A new feature | |
| 47 | +| fix | A bug fix | |
| 48 | +| docs | Documentation only changes | |
| 49 | +| style | Changes that do not affect meaning (formatting, etc.) | |
| 50 | +| refactor | Code change that neither fixes a bug nor adds a feature | |
| 51 | +| perf | A code change that improves performance | |
| 52 | +| test | Adding or correcting tests | |
| 53 | +| chore | Maintenance tasks (build process, tooling, dependencies) | |
| 54 | + |
| 55 | +--- |
| 56 | + |
| 57 | +## 🧠 Additional Notes |
| 58 | + |
| 59 | +- The commit hook will automatically validate your message. |
| 60 | +- If your commit is rejected, edit your message and try again. |
| 61 | +- For complex changes, you can add a longer body after the subject, separated by a blank line. |
| 62 | + |
| 63 | +Example: |
| 64 | +``` |
| 65 | +feat(core): support new user roles |
| 66 | +
|
| 67 | +This adds support for multiple user role types in the core module. Also refactors the existing permission system to be more scalable. |
| 68 | +``` |
| 69 | + |
| 70 | +--- |
| 71 | + |
| 72 | +# ✅ Quick Checklist Before Committing |
| 73 | + |
| 74 | +- [ ] Is my commit message following the format? |
| 75 | +- [ ] Is the type correct (`feat`, `fix`, `chore`, etc.)? |
| 76 | +- [ ] Did I specify the correct scope (`core`, `openSCD`, `distribution`, etc...) if applicable? |
| 77 | +- [ ] Is the message short, clear, and imperative? |
| 78 | + |
0 commit comments