Skip to content

Commit 378837a

Browse files
committed
more information about how to reason about commit messages
1 parent 95ad56c commit 378837a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

DEVELOPMENT.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,24 @@ Examples could be:
4848
- `make fmt`
4949
- thanks clippy
5050

51+
Please refrain from using `chore:` or `refactor:` prefixes as for the most part, users of the API don't care about those. When a `refactor`
52+
changes the API in some way, prefer to use `feat`, `change`, `rename` or `remove` instead, and most of the time the ones that are not `feat`
53+
are breaking so would be seen with their _exclamation mark_ suffix, like `change!`.
54+
55+
### Reasoning
56+
57+
Commit messages are used for guiding `cargo smart-release` to do most of the release work for us. This includes changelog generation
58+
as well as picking the right version bump for each crate.
59+
60+
## Commit splitting on breaking changes.
61+
62+
Knowing that `cargo smart-release` is driven by commit messages and affects their versions with per-crate granularity, it becomes important
63+
to split edits into multiple commits to clearly indicate which crate is actually broken.
64+
65+
Typical patterns include making a breaking change in one crate and then fix all others to work with it. For changelogs to look proper
66+
and version bumps to be correct, the first commit would contain only the breaking changes themselves,
67+
like "rename: `foo()` to `bar()`", and the second commit would contain all changes to adapt to that and look like "adapt to changes in `<crate name>`".
68+
5169
## Commit History
5270

5371
We generally follow a 'track everything' approach and there is a lot of freedom leading to more commits rather than less. There

0 commit comments

Comments
 (0)