diff --git a/docs/development/best-practices.md b/docs/development/best-practices.md index 0d53132317db0b53c6b953b79542aad5a3d845e1..5f06bc6af0668180408cb8b4490871d214388ead 100644 --- a/docs/development/best-practices.md +++ b/docs/development/best-practices.md @@ -3,6 +3,26 @@ This document explains our best practices. Follow these best practices when you're working on our code. +## Git branch names + +Branch names should start with a [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) scope like `feat/` or `fix/`. +If you're closing an issue with your PR then put the issue number after that. +Finally, add some short human-readable text to make it easier to identify. + +For example: + +- `feat/13732-cacache-cleanup` +- `fix/15431-gitea-automerge-strategy` +- `refactor/jest-reset-mocks` +- `docs/rewrite-packageRules-section` + +Avoid branch names like `patch-1`. + +If you don't know the correct Conventional Commit scope: give your branch a descriptive name like `issue-1-feature-foo`. + +If you forgot to pick a good branch name when you started work, then rename the branch before creating the pull request. +Read the [GitHub Docs, renaming a branch](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-branches-in-your-repository/renaming-a-branch) to learn how to rename your branch on GitHub. + ## General - Prefer full function declarations for readability and better stack traces, so avoid `const func = ():void => {}`