Skip to content

Commit 3d0c83f

Browse files
committed
docs: Update commit message guidelines
JIRA: CPOUI5FOUNDATION-1152
1 parent 935b292 commit 3d0c83f

File tree

1 file changed

+8
-41
lines changed

1 file changed

+8
-41
lines changed

docs/Guidelines.md

Lines changed: 8 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -13,48 +13,15 @@ During development, you might want to use `npm run unit` or `npm run unit-watch`
1313
Please use [rebase instead of merge](https://www.atlassian.com/git/tutorials/merging-vs-rebasing) to update a branch to the latest main. This helps keeping a clean commit history in the project.
1414

1515
### Commit Message Style
16-
#### Commit Summary
17-
The commit summary is the first line of the commit message.
18-
19-
- It should be **50-70 characters** long.
20-
- It must be **prefixed** by `[FIX]`, `[FEATURE]` or `[INTERNAL]` accordingly, followed by the name of the component or module which was the main subject of the change.
21-
+ Use `[FIX]` for bugfixes.
22-
+ Use `[FEATURE]` for new features / enhancements.
23-
+ Use `[BREAKING]` for breaking / incompatible changes.
24-
_**Note:** The commit body of a breaking change should also include a paragraph starting with `BREAKING CHANGE:`.
25-
This paragraph will be highlighted in the changelog._
26-
+ Use `[DEPENDENCY]` for dependency updates that should be mentioned in the changelog.
27-
+ Use `[INTERNAL]` for all other changes (e.g. refactorings, documentation, etc.). These changes will not be listed in the changelog.
28-
+ Exceptions are changes created by automated processes like releases or dependency updates
29-
- It must not contain `[` or `]` anywhere but in the prefix.
30-
- It shall be written in **imperative present tense** (as recommended by [Git](https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project))
31-
+ Examples: Instead of *"Adding tests for"* or *"I added tests for"* use *"Add tests for"* or *"Add feature xy"*.
32-
33-
#### Commit Body
34-
After the commit summary there should be an empty line followed by the commit body.
35-
36-
- Describe the intention and reasoning of the change
37-
- If a change fixes an issue reported on GitHub, add the following line to the commit message:
38-
+ `Fixes: #<issueNumber>` (e.g. `Fixes: #42`)
39-
- Breaking changes should include a paragraph starting with `BREAKING CHANGE:`. This paragraph will be highlighted in the changelog.
40-
41-
#### Example
42-
```
43-
[FIX] npm translator: Correct handling of devDependencies
44-
45-
- devDevependencies should only be included in certain cases
46-
- Was caused by a refactoring
47-
48-
Fixes: #42
49-
Fixes: #45
50-
```
5116

52-
## Work on Release Branches
53-
Major releases are typically prepared on dedicated branches like `next`.
17+
This project uses the [Conventional Commits specification](https://www.conventionalcommits.org/) to ensure a consistent way of dealing with commit messages.
5418

55-
There are some things to be aware of when working on these branches.
19+
#### Structure
5620

57-
### Implementing Changes in Multiple Code Lines
58-
While working on a new major release (e.g. `5.0.0`), any fixes or new features implemented on the **current** (main) code line (e.g. 4.x) should be cherry-picked as `[INTERNAL]` to the dedicated (pre-)release branch (typically `next`). This is to prevent changes declared as `[FEATURE]` or `[FIX]` from appearing in the changelog twice, which can be confusing since the new major version has not yet been released and should naturally contain any fixes or features released in any of the preceding releases. Listing them twice might confuse users. Note that our changelog is generated based on all tags of the repository, independent of the currently checked out branch (also see [git-chglog/issues/123](https://github.com/git-chglog/git-chglog/issues/123)).
21+
```
22+
type(scope): Description
23+
```
5924

60-
However, once a new major release becomes **current** (i.e. "main", not a pre-release), any changes applied to multiple code lines should be cherry picked with the original prefix, so that they appear for multiple versions in the changelog.
25+
- required: every commit message has to start with a lowercase `type`. The project has defined a set of [valid types](../commitlint.config.mjs#L10).
26+
- optional: the `scope` is typically the affected module. If multiple modules are affected by the commit, skip it or define a meaningful abstract scope.
27+
- required: the `description` has to follow the Sentence Case style. Only the first word and proper nouns are written in uppercase.

0 commit comments

Comments
 (0)