Skip to content

Commit 10b7d38

Browse files
committed
Auto merge of #14014 - epage:contrib, r=weihanglo
docs(contrib): Suggest atomic commits with separate test commits ### What does this PR try to resolve? This came up in a discussion with `@torhovland.` ### How should we test and review this PR? I'm unsure what the right weight is to put behind these suggestions - I don't want a lack of git history editing experience to get in the way of someone contributing - If people do anything, I'd like to see the tests split out ### Additional information
2 parents 1a504a5 + 03e3bc8 commit 10b7d38

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/doc/contrib/src/process/working-on-cargo.md

+15
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,21 @@ typically finish in under 30 minutes.
124124
The reviewer might point out changes deemed necessary. Large or tricky changes
125125
may require several passes of review and changes.
126126

127+
> **tip:** Prefer atomic commits where each commit is a single, complete, and coherent unit of work.
128+
> For example, if your feature work leads to renaming a module, make the rename its own commit.
129+
> However, adding an internal function that is unused is not complete or coherent.
130+
>
131+
> As part of your atomic commits, prefer adding tests as their own commit *before* any functionality changes.
132+
> The tests should pass in each commit, demonstrating the behavior before your
133+
> change and how each commit affects behavior.
134+
> This makes it easier for reviewers and community members to understand the
135+
> precise details of the side effects of your change and gives you confidence
136+
> that your tests are verifying the right behavior.
137+
>
138+
> Examples:
139+
> - [#13910: fix: remove symlink dir on Windows](https://github.com/rust-lang/cargo/pull/13910)
140+
> - [#14006: fix(add): Avoid escaping double-quotes by using string literals](https://github.com/rust-lang/cargo/pull/14006)
141+
127142
### Status labeling
128143

129144
PRs will get marked with [labels] like [`S-waiting-on-review`] or [`S-waiting-on-author`] to indicate their status.

0 commit comments

Comments
 (0)