Skip to content

Commit 496722b

Browse files
Enhance CONTRIBUTING.md with PR and branch naming guidelines (#3067)
* Enhance CONTRIBUTING.md with PR and branch naming guidelines Added guidelines for keeping pull requests small and clarified branch naming conventions for issue fixes. * note related bugs in 1 PR probably okay Clarify guidelines for submitting PRs by emphasizing not to fix unrelated bugs in a single PR.
1 parent 8c58d4a commit 496722b

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

CONTRIBUTING.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Copyright © 2018-2024 LunarG, Inc.
2020
1. [Issue Fix](#issue-fix)
2121
1. [New Feature or Improvement](#new-feature-or-improvement)
2222
1. [Shared Forks](#shared-forks)
23+
1. [Keep PRs small](#keep-prs-small)
2324
1. [Coding Guidelines](#coding-guidelines)
2425
1. [GFXR Do's](#gfxr-dos)
2526
1. [GFXR Don'ts](#gfxr-donts)
@@ -153,15 +154,15 @@ Because of this, we suggest naming in the following fashion:
153154

154155
#### Issue Fix
155156

156-
If fixing an issue, create a branch based on the issue number, like `fix-1234`
157-
where `1234` is the issue number in Github.
157+
If fixing an issue, create a branch based on the fix, like `fix-createinstance-crash`.
158+
In the description, write "Fixes #1234". When the PR is merged, issue #1234 will automatically be closed.
158159

159160
#### New Feature or Improvement
160161

161162
If adding a new feature or cleaning up existing changes, provide a descriptive
162163
branch name.
163164

164-
If the change fixes a race condition in pipeline submit, it could be named
165+
As an example, If the change fixes a race condition in pipeline submit, it could be named
165166
`fix-pipeline-submit-race-condition`.
166167
Even if the name conflicts with another developer's branch, the branch
167168
resides on your fork and appears to the main Github repo as
@@ -172,11 +173,21 @@ resides on your fork and appears to the main Github repo as
172173
If sharing a fork with multiple people (for example all from the same company),
173174
it might be useful to prepend the branch with your user nam.
174175

175-
For example, instead of `fix-1234` one might create a branch `bob-fix-1234`
176+
For example, instead of `fix-createinstance-crash` one might create a branch `alice-createinstance-crash`
176177
to differentiate the work from other people working in the repo.
177178

178179
<br/>
179180

181+
#### Keep PRs small
182+
183+
Submitting multiple unrelated changes in a PR makes reviewing the PR difficult. Create PRs for which the a reviewer can hold the entire change in their head and answer "is this correct and complete?" in a single sitting.
184+
185+
Some suggestions to help this process:
186+
* Don't fix unrelated bugs in one PR.
187+
* Don't change in a PR the style of code that isn't related to the new functionality or bugfix in the PR.
188+
* Separate a refactor from a bugfix in which you discovered the refactor was helpful. It is okay to have two PRs reference each other in the description.
189+
190+
180191
## Coding Guidelines
181192

182193
### GFXR Do's
@@ -191,11 +202,9 @@ to differentiate the work from other people working in the repo.
191202
1. Don’t hand-edit C++ headers or implementation files in `framework/generated`.
192203
To change those files, edit the Python generator scripts and run the
193204
generator as noted in [Rebase on Dev](#rebase-on-dev)
194-
195-
196205
2. Don't perform unnecessary work in your change (like performing additional
197206
cleanup beyond your change).
198-
3. Do not alter existing capture file block structs or IDs.
207+
4. Do not alter existing capture file block structs or IDs.
199208
Instead, create new IDs and structs, and deprecate the old blocks so they
200209
continue to be decoded and consumed.
201210

0 commit comments

Comments
 (0)