Skip to content

Commit d5e3d49

Browse files
committed
doc(contrib): add commit message requirements
Add a subsection in CONTRIBUTING.adoc describing the commit message requirements. TODO: Decide how this applies to PR title/body.
1 parent 5c01a57 commit d5e3d49

File tree

1 file changed

+85
-2
lines changed

1 file changed

+85
-2
lines changed

CONTRIBUTING.adoc

Lines changed: 85 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,92 @@ There should be a corresponding https://github.com/riscv-software-src/riscv-unif
4545
All patches must meet the UnifiedDB code standards. This includes:
4646

4747
* Pass regression tests (run locally as `./do test:regress`)
48+
* Use appropriate commit messages
4849
* Go through code review as a Pull Request
49-
** Code owners must approve
50-
* Use appropriate commit messages (TODO: commit message policy)
50+
51+
=== Regression tests
52+
53+
All contributions must pass the full suite of regression tests.
54+
Regression tests are checked in GitHub for every PR, and they can also be run locally using `./do test:regress`.
55+
56+
If a Pull Request adds a new feature that is not already covered by the regression test suite, it
57+
must add at least one new test.
58+
59+
=== Commit messages
60+
61+
UnifiedDB adheres to https://www.conventionalcommits.org/en/v1.0.0[Conventional Commits v1.0.0].
62+
63+
The guidelines below are adapted from https://github.com/angular/angular/blob/main/contributing-docs/commit-message-guidelines.md[the Angular commit message guidelines].
64+
65+
Every commit message consists of a mandatory *header*, a mandatory *body*, and an optional *footer*.
66+
67+
```
68+
<header>
69+
<BLANK LINE>
70+
<body>
71+
<BLANK LINE>
72+
<footer>
73+
```
74+
75+
==== Header
76+
77+
.UnifiedDB commit header format
78+
```
79+
<type>(<scope>): <short summary>
80+
│ │ │
81+
│ │ └─⫸ Summary in present tense. Not capitalized. No period at the end.
82+
│ │
83+
│ └─⫸ Commit Scope: single word describing the affected component
84+
85+
└─⫸ Commit Type: build|ci|correct|data|docs|feat|fix|refactor|schema|test
86+
```
87+
88+
The `<type>` and `<summary>` fields are mandatory. The `<scope>` field is optional.
89+
90+
Type must be one of the following:
91+
92+
[cols="1l,3,2l"]
93+
|===
94+
| Type | Description | Example scopes
95+
96+
| build | Changes that affect the build system or external dependencies | rake, antora
97+
| ci | Changes to the CI configuration files and script | action
98+
| correct | A correction to data in the database (_i.e., a database bugfix) | ext, inst, csr
99+
| data | An addition to the database contents | ext, inst, csr
100+
| docs | Documentation-only changes | schema, ruby-db, <backend name>
101+
| feat | A new feature | ruby-db, <backend name>
102+
| fix | A code bug fix | ruby-db, <backend name>
103+
| refactor | A code change that neither fixes a bug nor adds a feature | ruby-db, <backend name>
104+
| schema | A change to the database schema | ext, inst, csr
105+
| test | Adding missing tests or correcting existing tests | schema, ruby-db
106+
|===
107+
108+
==== Body
109+
110+
Just as in the summary, use the imperative, present tense: "fix" not "fixed" nor "fixes".
111+
112+
Explain the motivation for the change in the commit message body. This commit message should explain
113+
_why_ you are making the change.
114+
You can include a comparison of the previous behavior with the new behavior in order to illustrate
115+
the impact of the change.
116+
117+
==== Footer
118+
119+
A footer is required when the commit introduces a breaking change or closes a GitHub issue. For example:
120+
121+
```
122+
BREAKING CHANGE: <breaking change summary>
123+
<BLANK LINE>
124+
<breaking change description + migration instructions>
125+
<BLANK LINE>
126+
<BLANK LINE>
127+
Fixes #<issue number>
128+
```
129+
130+
=== Code review
131+
132+
All Pull Requests must go through the code review process.
133+
51134

52135
== Finding tasks
53136

0 commit comments

Comments
 (0)