Skip to content

Commit 4f68365

Browse files
Merge pull request swiftlang#69125 from AnthonyLatsis/not-my-first-pull-request
[docs] FirstPullRequest: Update and improve sections on tidying up & code review
2 parents a6987f4 + 7130132 commit 4f68365

File tree

1 file changed

+37
-19
lines changed

1 file changed

+37
-19
lines changed

docs/HowToGuides/FirstPullRequest.md

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,26 @@ make changes, run tests and debug issues.
9898

9999
## Submitting a pull request
100100

101-
### Tidying up
102-
103101
Alright! You've implemented a change and would like to submit it.
104-
Double-check that you've tidied your Git history, such as squashing
105-
work-in-progress commits, and that your commit messages provide context.
106-
For example, if a commit fixes a bug, then include a "Fixes SR-NNNNN" with the
107-
bug number in the commit message.
108102

109-
Next, [format your changes](/docs/HowToGuides/FAQ.md#how-do-i-format-my-changes)
110-
using `clang-format`.
103+
### Tidying up
104+
105+
> **Note**
106+
> If you intend to create a [draft pull request][draft-pr], you can tidy up
107+
> later *before* marking it as ready for review.
108+
109+
1. [Tidy up your commit history](FAQ.md#how-do-i-clean-up-my-git-history):
110+
* Squash work-in-progress commits.
111+
* Break up your changes into as many self-sufficient, meaningful commits as
112+
you can, rather than cramming everything into a single commit.
113+
For example, a patch that renames a function (1) and modifies an algorithm
114+
(2) can be split into two commits.
115+
A self-sufficient commit must compile, pass all tests, and contain
116+
any associated test changes.
117+
This practice is key to efficient and rigorous code review processes,
118+
as well as a neat, transparent, and actionable commit history.
119+
* [Top off your commit messages](https://swift.org/contributing/#commit-messages).
120+
1. Tidy up and [format your code changes](FAQ.md#how-do-i-format-my-changes).
111121

112122
### Pushing and creating a pull request
113123

@@ -120,21 +130,29 @@ show a helpful "Compare & Pull Request" button.
120130

121131
![Compare & Pull Request button in GitHub UI](/docs/GitHubCreatePRScreenshot.png)
122132

133+
[draft-pr]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests#draft-pull-requests
123134
[create a pull request]: https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request#creating-the-pull-request
124135

125136
## Asking for code review
126137

127-
If you had an active discussion with someone on how to implement your change,
128-
you can `@` mention them in the PR description and ask for code review.
129-
If you directly implemented the change without any guidance from anyone else,
130-
`@` mention someone from GitHub's suggested reviewers. If GitHub doesn't
131-
make any suggestions, ask the [Code Owner](https://github.com/apple/swift/blob/main/CODE_OWNERS.TXT) based on the
132-
component for your change. Please ask someone though! We don't want you to get
133-
stuck because you were not sure who to ask for code review.
134-
135-
At the beginning, contributors are not able to run the continuous integration
136-
(CI) bot, which builds the project and runs tests. Please ask your code
137-
reviewer(s) to invoke the bot for you.
138+
Collaborators and code owners are automatically requested for review per the
139+
[CODEOWNERS](/.github/CODEOWNERS) file. If no one is automatically requested for
140+
review, @mention and ask a suggested person under **Reviewers** to review your
141+
changes. If no reviewer suggestions are shown either, please
142+
[message][contributor-experience] the Contributor Experience Workgroup on the
143+
Swift forums to sort out review requests for you.
144+
145+
You are welcome to invite other people for review as well — say, someone you
146+
had an active discussion with on how to implement your change.
147+
Anyone with a GitHub account can review or comment on changes proposed to
148+
this repository!
149+
150+
Contributors without
151+
[write access](https://swift.org/contributing/#commit-access) are not able to
152+
run the continuous integration (CI) bot, which builds the project and runs
153+
tests. Please ask a code reviewer with write access to invoke the bot for you.
154+
155+
[contributor-experience]: https://forums.swift.org/g/contributor-experience-workgroup
138156

139157
## Responding to code review comments
140158

0 commit comments

Comments
 (0)