Convention

Branch

Format of the branch name

<author-name>-<type>-<subject>-<ID>

The <ID> can be empty (e.g. if the change isn't assign to a JIRA task ).

The <subject> must be short and rational.

If <subject be more than 1 word we must separate it by underscore(_).

Branch type categories

  1. Code flow types: These branches which we expect to be permanently available on the repository follow the flow of code changes starting from development until the production.

  2. Temporary types: As the name implies, these are disposable branches that can be created or deleted when needed.

Code flow types

  • development: All new features and bug fixes should be brought to this branch.

  • master: The production branch, if the repository is published, this is the default branch being presented.

Temporary types

  • feature: Any code changes for a new module or use case should be done on a feature branch. This branch is created based on the current development branch. When all changes are 'Done', a PR is needed to put all of these to the development branch.

  • bugfix: If the code changes made from the development branch were rejected after a release, sprint or demo, any necessary fixes after that should be done on this branch.

Examples

alireza-feature-toast-23
mohammad-feature-device_support-35
ahmad-bugfix-more_gray_shades
arian-bugfix-scaling_threshold

This document is based on Git Branch Naming Convention.

Commit message

The commit message should be structured as follows:

<type>[scope]: <description>

Allowed <type> values

  • feat for changes made to add a new feature or functionality.

  • fix for changes made to fix a bug or issue.

  • refactor for refactoring code, e.g. renaming a variable.

Allowed <scope> values

Frontend

  • comp layout, animation, style.

Backend

  • view modules that define logics for handling user input.

  • serializer/schema any logic that validate and convert user input to database model.

  • model classes that define ORM models.

AI/ML

  • data data preprocessing, data cleaning and data analysis.

  • model model training, hyperparameter tunning, model evaluation, model deployment and transfer-learning.

App

  • ui components and any style codes

Robotics

If it's related to a Microcontroller use MCU (Microcontroller Unit) and if it's related to Mini-PCs use SBC (Single Board Computer) Prefix.

  • core for main.ino (On Arduino) or main.py (On SBC).
  • utils every reusable general local package.
  • module-name module scope, for example: module-SRF, module-faceRecognition
  • mix mixture of two or more than above scopes.
  • mcu-core
  • mcu-utils
  • mcu-module-name
  • mcu-mix
  • sbc-core
  • sbc-utils
  • sbc-module-name
  • sbc-mix

Common

  • infra configuration for build system, linting, folder structure and any project setup.

  • docs all kinds of documentations.

  • utils helper module, error handling, convertors and every reusable local packages.

  • core state management, app logic and algorithm.

  • mix mixture of two or more than above scopes.

Specification

1) no dot (.) at the end

2) don't capitalize first letter

3) limit the subject line to 50 characters

4) use the imperative, present tense: "change" not "changed" nor "changes"

NOTE: consider each commit should do just one task.

Examples

feat(infra): config redux
fix(ui): fix login screen responsiveness
refactor(model): tune model hyperparameter
fix(core): fix algorithm performance issue
feat(utils): add convertor for formatting Jalali date