Pull Request Template
A Pull Request template is a standardized document that helps developers submit high-quality PRs. By providing a consistent format, the template allows team members to understand and review code changes more efficiently. The following is a guide to creating and using GitCode Pull Request templates.
Creating a Pull Request Template
-
Choose the template location:
You can place the PR template in the project's
.gitcode/folder (create it if it does not exist), or place it indocs/or.gitcode/PULL_REQUEST_TEMPLATE/directory, and create aPULL_REQUEST_TEMPLATE.mdfile within it. You can create multiple template files in the.gitcode/PULL_REQUEST_TEMPLATE/folder, and GitCode will display the created templates when a PR is created for this project for use.
提示The template configuration must be placed in the default branch of the repository. If you create the template in another branch, the configuration will not take effect, and the related features cannot be used by collaborative users.
-
Write the template content:
Write the content of the template in the
PULL_REQUEST_TEMPLATE.mdfile. You can include some basic header information, problem description, change type, test instructions, and any additional notes or explanations. Make sure to prompt contributors to provide all the information you think is helpful for the review. You can configure front-matter information in the new.mdfile, including the title of the PR template, the person assigned to merge, and the specified label. Also add the body content in the new.mdfile, which will be pre-filled into the description when a user creates a new PR.Example Template:
---
title: "【PR template】:"
labels: ["fix","bug"]
assignees: 'username'
---
# Pull Request Template
----
## Description
Provide a high-level overview of this Pull Request.
## Type
- [ ] Bug Fix
- [ ] New Feature
- [ ] Code Style Update (Formatting, Local Variables)
- [ ] Refactor (i.e., code changes that are neither new features nor bug fixes)
- [ ] Changes to the build process or auxiliary tools
- [ ] Documentation updates
## How to Test
Describe the steps to test this change, including which files need to be modified.
## Checklist:
- [ ] My code follows the style of this project
- [ ] I have tested my code myself
- [ ] I have updated the corresponding documentation
- [ ] I have updated the relevant change log as needed
- [ ] I have correctly used the type tag in the title (e.g., `feat:`, `fix:`)
## Additional Information
Add any additional notes related to this Pull Request here.