You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+30-10Lines changed: 30 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,22 +29,42 @@ to re-work some of it and the discouragement that goes along with that.
29
29
30
30
### Process
31
31
32
-
When you first post a PR, we request that the commit history get cleaned
33
-
up. We recommend avoiding this during the PR to make it easier to review how
34
-
feedback was handled. Once the commit is ready, we'll ask you to clean up the
35
-
commit history. Once you let us know this is done, we can move forward with
36
-
merging! If you are uncomfortable with these parts of git, let us know and we
37
-
can help.
38
-
39
-
We ask that all new files have the copyright header. Please update the
40
-
copyright year for files you are modifying.
41
-
42
32
As a heads up, we'll be running your PR through the following gauntlet:
43
33
- warnings turned to compile errors
44
34
-`cargo test`
45
35
-`rustfmt`
46
36
-`clippy`
47
37
-`rustdoc`
38
+
-[`committed`](https://github.com/crate-ci/committed) as we use [Conventional](https://www.conventionalcommits.org) commit style
39
+
-[`typos`](https://github.com/crate-ci/typos) to check spelling
40
+
41
+
Not everything can be checked automatically though.
42
+
43
+
We request that the commit history gets cleaned up.
44
+
We ask that commits are atomic, meaning they are complete and have a single responsibility.
45
+
PRs should tell a cohesive story, with test and refactor commits that keep the
46
+
fix or feature commits simple and clear.
47
+
48
+
Specifically, we would encouage
49
+
- File renames be isolated into their own commit
50
+
- Add tests in a commit before their feature or fix, showing the current behavior.
51
+
The diff for the feature/fix commit will then show how the behavior changed,
52
+
making it clearer to reviewrs and the community and showing people that the
53
+
test is verifying the expected state.
54
+
- e.g. [clap#5520](https://github.com/clap-rs/clap/pull/5520)
55
+
56
+
Note that we are talking about ideals.
57
+
We understand having a clean history requires more advanced git skills;
58
+
feel free to ask us for help!
59
+
We might even suggest where it would work to be lax.
60
+
We also understand that editing some early commits may cause a lot of churn
61
+
with merge conflicts which can make it not worth editing all of the history.
62
+
63
+
For code organization, we recommend
64
+
- Grouping `impl` blocks next to their type (or trait)
65
+
- Grouping private items after the `pub` item that uses them.
66
+
- The intent is to help people quickly find the "relevant" details, allowing them to "dig deeper" as needed. Or put another way, the `pub` items serve as a table-of-contents.
0 commit comments