Skip to content

Commit 7205f20

Browse files
authored
Add commit guidelines in CONTRIBUTING.md (#2745)
1 parent fa3b584 commit 7205f20

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

CONTRIBUTING.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
## Commit message guidelines
2+
3+
For the first line (summary) of the commit message:
4+
5+
- Include the issue number at the beginning, when applicable
6+
- If it’s a followup change for an issue, use the format SF-1234b
7+
- Multiple issues can be listed if needed
8+
- [Use imperative mood](https://cbea.ms/git-commit/#imperative) (i.e. start commit with a verb like “Fix”, not “Fixed”)
9+
- Explain what changed, not how it changed
10+
- The summary should explain what happens from a user's perspective, not what you did to fix a bug
11+
- Contextualize the change, even at the cost of being less specific
12+
- It's more important to make clear the type of change (bug fix, feature), and what the impact is, than to be specific but miss the context.
13+
- A good example of this is `SF-2892 Fix error when Serval admin enables drafting (#2637)`. The summary doesn't have enough room to state what the error was, but makes clear what context it exists in. Further details can be included in the body of a commit message if needed.
14+
- Hotfixes should should be prefixed with `hotfix: ` followed by the original summary
15+
16+
## Merging pull requests
17+
18+
- In nearly all cases, squash and merge should be used
19+
- The commit message should end with the PR number in parentheses (in most situations GitHub does this by default)
20+
- Clean up the commit message so any irrelevant information is removed (e.g. messages from fixup commits)

0 commit comments

Comments
 (0)