Pull Request Best Practices for CONTRIBUTING.md
Document pull request best practices in your CONTRIBUTING.md. Cover PR size, descriptions, linking issues, CI requirements, and the merge strategy.
Detailed Explanation
Pull Request Best Practices
A well-documented PR process reduces back-and-forth between contributors and maintainers. Include these sections in your contributing guide.
PR Size
## Pull Request Guidelines
Keep PRs focused and small:
- Ideal: < 400 lines changed
- Acceptable: < 800 lines
- Needs splitting: > 800 lines
Large PRs are harder to review, more likely to introduce bugs,
and take longer to merge.
PR Description Template
## Description
Brief description of changes.
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## How to Test
Steps to verify the changes.
## Related Issues
Closes #123
Linking Issues
Always link related issues using GitHub keywords:
Closes #123-- Automatically closes the issue on mergeFixes #456-- Same as ClosesRelates to #789-- Links without closing
CI Requirements
List what must pass before review:
- Linting (
npm run lint) - Unit tests (
npm test) - Build (
npm run build) - Type checking (
npm run typecheck)
Merge Strategy
Document which merge strategy you use:
- Squash and merge -- All commits become one; keeps main history clean
- Rebase and merge -- Preserves individual commits; requires clean history
- Merge commit -- Creates a merge commit; preserves full branch history
Draft PRs
Encourage early drafts:
Open a draft PR early if you want feedback on your approach before completing the implementation. Draft PRs will not be formally reviewed but maintainers may offer guidance.
Use Case
A project where pull request quality varies widely and maintainers want to establish clear standards for PR size, descriptions, and the review process.