📖
Як писати commit messages
fix, feat, docs, refactor — конвенція Conventional Commits яку всі використовують
Conventional Commits — стандарт індустрії
Формат: 'тип(область): опис'
| Тип | Коли використовувати | Приклад |
|---|---|---|
| feat | Нова функція | 'feat: add user login' |
| fix | Виправлення бага | 'fix: correct email validation' |
| docs | Документація | 'docs: update README' |
| style | Форматування | 'style: fix indentation' |
| refactor | Рефакторинг | 'refactor: extract helper function' |
| test | Тести | 'test: add unit tests for auth' |
| chore | Технічні завдання | 'chore: update dependencies' |
📝
Хороший commit message = газетний заголовок
Уяви що твій commit message — заголовок у газеті. Він має відповідати на питання 'Що змінилось?' а не 'Як?'. Поганий: 'fixed stuff'. Гарний: 'fix: resolve infinite loop in search function'. Майбутній ти скажуть 'дякую'.
Корисні дієслова для commit messages
| Дієслово | Переклад | Приклад |
|---|---|---|
| add | додати | 'add user profile page' |
| remove | видалити | 'remove deprecated API calls' |
| update | оновити | 'update dependencies to v2' |
| fix | виправити | 'fix navigation overflow bug' |
| implement | реалізувати | 'implement dark mode toggle' |
| improve | покращити | 'improve loading performance' |
| refactor | рефакторити | 'refactor auth middleware' |
Pull Request — як описувати
Структура хорошого PR:
'''markdown
What changed
Added user authentication with JWT tokens.
Why
Users need to log in to access their personal data.
How to test
- Go to /login
- Enter credentials
- Verify token in localStorage
Screenshots
[attach if UI changed] '''