-
Small and Focused Changes:
- PRs should focus on addressing a specific issue, implementing a single feature, or fixing a bug. Keep changes small and avoid bundling unrelated changes in the same PR.
-
Branch Naming Convention:
- Use descriptive branch names that reflect the purpose of the PR. For example, use
feature/add-authentication
orbugfix/fix-login-issue
.
- Use descriptive branch names that reflect the purpose of the PR. For example, use
-
Code Quality:
- Ensure your code follows the project's coding style and conventions.
- Run linters and code formatters before submitting a PR to maintain code quality.
-
Test Coverage:
- Write tests for new features or changes to ensure they work as expected.
- Ensure existing tests continue to pass with your changes.
-
Documentation:
- Update documentation to reflect any changes made in the PR.
- Include code comments where necessary to explain complex logic.
-
Commit Messages:
- Write clear and concise commit messages that explain the purpose of each commit.
- Use a conventional format like "feat(ordinal): implement transfers" or "fix(service-worker): resolve issue with listener."
-
Rebase and Resolve Conflicts:
- Before merging, ensure your PR is up-to-date with the latest changes from the main branch. Resolve any conflicts that arise during the rebase.
-
Peer Review:
- Request a code review from one or more maintainers.
- Reviewers should provide constructive feedback and check for code quality, functionality, and adherence to project standards.
-
CI/CD Checks:
- Ensure any continuous integration (CI) tests pass successfully.
- Make sure the code builds and deploys correctly in the target environment.
-
Use Labels and Milestones:
- Apply labels to categorize PRs (e.g., bug, feature, documentation).
- Associate PRs with project milestones when applicable.
-
Avoid Force Pushing:
- Once a PR is open, avoid force-pushing changes to the branch. If you need to update the PR, make new commits.
-
Ownership and Responsibility:
- Assign the PR to the person responsible for reviewing and merging it.
- Authors should address feedback promptly and engage in the review process.
-
Merging:
- PRs should be merged after receiving approval from reviewers and passing all checks.
-
Delete Branches:
- After a successful merge, delete the feature or bugfix branch unless it's a long-lived branch or follows a specific naming convention (e.g.,
release/1.0
).
- After a successful merge, delete the feature or bugfix branch unless it's a long-lived branch or follows a specific naming convention (e.g.,
-
Changelog Updates:
- If your project maintains a changelog, update it with changes introduced in the PR.
-
Security and Compliance:
- Consider security implications in your code changes.
-
Communication:
- Provide context and any relevant information in the PR description.