Skip to content

Commit 1a1d218

Browse files
Update commit style docs
Co-authored-by: acidicMercury8 <acidicmercury8@outlook.com>
1 parent 7c371fe commit 1a1d218

File tree

2 files changed

+175
-27
lines changed

2 files changed

+175
-27
lines changed

doc/commit-style.md

Lines changed: 88 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,110 @@ Commit style accepted in __IX-Ray__ project
88

99
The project accepts commit standard for transparency and comprehension of the changes being made. The acceptable commit style is described below
1010

11-
## Naming
11+
## General rules
12+
13+
- Commit messages must be written in English.
14+
- Each commit message should be structured to answer the question: __"If this commit is applied, it will..."__
15+
- The message must start with a verb in the infinitive form without the `to` particle
16+
- No flags like `[Fix]`, `[UPDATE]`, or other tags should be included. The verb should directly describe the action performed
17+
- Commit messages should be brief but descriptive, with additional details added in a long description if needed
18+
- Capitalize the first letter of the commit message
19+
- If you are unsure how to write in English, clearly describe what you did in your native language (no gibberish, we will translate and refine it later)
20+
21+
## Commit message structure
1222

1323
### Initial commits
1424

15-
Initial commit message should be written in the following style:
25+
Initial commit messages should follow this structure:
1626

1727
```text
1828
Initial commit
1929
```
2030

2131
### Regular commits
2232

23-
- Pattern
33+
Regular commit messages consist of one part, optionally followed by a long description:
34+
35+
```text
36+
<Commit message body>
37+
38+
<Long description if necessary>
39+
```
40+
41+
### Length guidelines
42+
43+
- The maximum length for the commit message header is __72 characters__
44+
- Each line in the long description should also not exceed __72 characters__
45+
46+
## Writing commit messages
47+
48+
### Header format
49+
50+
The commit message header must begin with a verb in the infinitive form that describes the action taken in the commit. Examples:
51+
52+
- `Fix window manager implementation`
53+
- `Implement audio output support`
54+
- `Remove obsolete configurations`
55+
- `Add documentation for API endpoints`
56+
- `Optimize rendering pipeline`
57+
58+
#### Specific rules for nouns
59+
60+
If the message includes a noun, make sure to structure it naturally for clarity:
61+
62+
- `Implement new devices support (preferred)`
63+
- `Add new gizmo support (preferred)`
64+
- `Add support for AMD FSR (less desirable, use the structure above)`
65+
- `Implement support for new devices (less desirable, rephrase as shown in the examples above)`
66+
67+
It is recommended to place the main noun after any qualifiers when possible for better readability
68+
69+
### Examples of correct messages
70+
71+
#### Single-line messages
72+
73+
- `Fix memory leak in database connector`
74+
- `Refactor logging system for clarity`
75+
- `Update README with installation instructions`
76+
- `Remove deprecated API calls`
77+
78+
#### Messages with long descriptions
79+
80+
```text
81+
Fix rendering issue in graphics pipeline
82+
83+
The rendering pipeline had a bug causing frame drops on low-end GPUs. This fix optimizes shader execution and resolves the issue.
84+
```
85+
86+
```text
87+
Add unit tests for input validation
88+
89+
Unit tests cover edge cases for user input to ensure stability and prevent crashes during unexpected inputs.
90+
```
91+
92+
## Common mistakes to avoid
93+
94+
- __Using tags or brackets:__
2495

25-
Regular commit message should consist of one part and be built according to the following template:
96+
- Incorrect: `[Fix] Resolve bug in module`
97+
- Correct: `Fix bug in module`
2698

27-
```test
28-
Commit message body
99+
- __Starting with a non-verb:__
29100

30-
Long description if necessary
31-
```
101+
- Incorrect: `Bugfix for network error`
102+
- Correct: `Fix network error`
32103

33-
Commit message body and description should briefly reflect the meaning of the commit changes
104+
- __Improper verb placement:__
34105

35-
Commit message body should be written starting with a capital letter
106+
- Incorrect: `Implementing new feature`
107+
- Correct: `Implement new feature`
36108

37-
First word should denote the verb of the action performed by the commit, this word should be in the infinitive form without the `to` particle
109+
- __Using incomplete sentences:__
38110

39-
Description should be separated from the body by one empty line
111+
- Incorrect: `Fixed bug`
112+
- Correct: `Fix UI layout bug`
40113

41-
- Length
114+
- __Improper noun placement:__
42115

43-
The maximum length of the commit header or the commit description line is 72 characters
116+
- Incorrect: `Add support new layout`
117+
- Correct: `Add new layout support`

doc/commit-style.rus.md

Lines changed: 87 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,17 @@
88

99
В проекте принят стандарт фиксаций для обеспечения прозрачности и понимания вносимых изменений. Приемлемый стиль фиксаций описан ниже
1010

11-
## Именование
11+
## Общие Правила
12+
13+
- Сообщения к коммитам должны быть написаны на английском языке
14+
- Каждое сообщение должно отвечать на вопрос: __"Если этот коммит будет применён, он..."__
15+
- Сообщение должно начинаться с глагола в инфинитиве без частицы `to`
16+
- Никаких флагов, таких как `[Fix]`, `[UPDATE]` и т.п., использовать не нужно. Глагол должен чётко описывать выполненное действие
17+
- Сообщение должно быть кратким, но информативным. При необходимости можно добавить дополнительное описание
18+
- Первая буква сообщения должна быть заглавной
19+
- Если вы не уверены, как написать на английском, напишите на своём родном языке, чётко описывая, что вы сделали (избегайте "бреда", мы переведём и доработаем сообщение)
20+
21+
## Структура Сообщений
1222

1323
### Начальные фиксации
1424

@@ -20,24 +30,88 @@ Initial commit
2030

2131
### Рабочие фиксации
2232

23-
- Шаблон
33+
Обычное сообщение о фиксации должно состоять из одной части и быть построено в соответствии со следующим шаблоном:
34+
35+
```text
36+
<Основное сообщение коммита>
37+
38+
<Дополнительное описание, если необходимо>
39+
```
40+
41+
### Ограничения по длине
42+
43+
- Максимальная длина заголовка сообщения коммита — __72 символа__
44+
- Каждая строка в дополнительном описании также не должна превышать __72 символа__
45+
46+
## Правила Написания Сообщений
47+
48+
### Формат Заголовка
49+
50+
Сообщение коммита должно начинаться с глагола в инфинитиве, описывающего действие, выполненное в коммите. Примеры:
51+
52+
- `Fix window manager implementation`
53+
- `Implement audio output support`
54+
- `Remove obsolete configurations`
55+
- `Add documentation for API endpoints`
56+
- `Optimize rendering pipeline`
57+
58+
#### Особые правила для существительных
59+
60+
Если сообщение включает существительное, важно правильно разместить его, чтобы фраза звучала естественно:
61+
62+
- `Implement new devices support (предпочтительно)`
63+
- `Add new gizmo support (предпочтительно)`
64+
- `Add support for AMD FSR (нежелательно, используйте структуру выше)`
65+
- `Implement support for new devices (нежелательно, переформулируйте как в примерах выше)`
66+
67+
Рекомендуется, чтобы основное существительное шло после уточнений, если это возможно, для лучшей читаемости
68+
69+
### Примеры корректных сообщений
70+
71+
#### Однострочные сообщения
72+
73+
- `Fix memory leak in database connector`
74+
- `Refactor logging system for clarity`
75+
- `Update README with installation instructions`
76+
- `Remove deprecated API calls`
77+
78+
#### Сообщения с дополнительным описанием
79+
80+
```text
81+
Fix rendering issue in graphics pipeline
82+
83+
The rendering pipeline had a bug causing frame drops on low-end GPUs. This fix optimizes shader execution and resolves the issue.
84+
```
85+
86+
```text
87+
Add unit tests for input validation
88+
89+
Unit tests cover edge cases for user input to ensure stability and prevent crashes during unexpected inputs.
90+
```
91+
92+
## Типичные ошибки
93+
94+
- __Использование тегов или скобок:__
2495

25-
Обычное сообщение о фиксации должно состоять из одной части и быть построено в соответствии со следующим шаблоном:
96+
- Некорректно: `[Fix] Resolve bug in module`
97+
- Корректно: `Fix bug in module`
2698

27-
```test
28-
Тело сообщения фиксации
99+
- __Начало не с глагола:__
29100

30-
Длинное описание, если необходимо
31-
```
101+
- Некорректно: `Bugfix for network error`
102+
- Корректно: `Fix network error`
32103

33-
Текст сообщения о фиксации и описание должны кратко отражать смысл изменений, внесенных при фиксации
104+
- __Неправильное использование глаголов:__
34105

35-
Текст сообщения о фиксации должен начинаться с заглавной буквы
106+
- Некорректно: `Implementing new feature`
107+
- Корректно: `Implement new feature`
36108

37-
Первое слово должно обозначать глагол действия, выполняемого коммитом, это слово должно быть в форме инфинитива без частицы `to`
109+
- __Неполные предложения:__
38110

39-
Описание должно быть отделено от основного текста одной пустой строкой
111+
- Некорректно: `Fixed bug`
112+
- Корректно: `Fix UI layout bug`
40113

41-
- Длина
114+
- __Неверное расположение существительного:__
42115

43-
Максимальная длина заголовка фиксации или строки описания фиксации составляет 72 символа
116+
- Некорректно: `Add support new layout`
117+
- Корректно: `Add new layout support`

0 commit comments

Comments
 (0)