Skip to content

Code Requirements

Kai Hirafune edited this page May 1, 2024 · 10 revisions

Naming Conventions

Branches

General Rules for Branches

  1. Branches should follow the template <Ticket-Number>/<Type of Branch>/<Brief-Description>
  2. Branches should follow PascalCase (Every word is capitalized)
  3. Branches cannot have spaces between words so use / and - for branch descriptions (Look at examples of branch naming if confused)

Types of Branches and Examples

  1. feat:
  • Use this prefix when introducing a new feature or functionality to the project
  • Example: UADS-18/feat/About-Page
  1. fix:
  • Use this prefix when addressing a bug or issue in the codebase.
  • Example: UADS-31/fix/Fix-Authentication-Issue
  1. docs:
  • Use this prefix when making changes or additions to documentation, such as README files or code comments.
  • Example: UADS-2/docs/Update-README
  1. style:
  • Use this prefix when making cosmetic changes to the codebase such as formatting, indentation or anything CSS related
  • Example: UADS-58/stlye/Format-Code
  1. refactor:
  • Use this prefix when restructuring or optimizing existing code without changing its external behavioral such as renaming variables
  • Example: UADS-98/refactor/Simplify-Authentication-Logic
  1. test:
  • Use this prefix when adding, modifying, or removing tests for the codebase.
  • Example: UADS-45/test/Add-Unit-Tests
  1. chore:
  • Use this prefix for miscellaneous tasks or changes that do not fit into any other category, such as updating dependencies or configuring build tools.
  • Example: UADS-115/chore/Update-Package-Dependencies

Commits

General Rules for Commits

Commits should follow the template <Ticket-Number> <Type of Commit>: <Brief-Description> and they should be a maximum of 50 characters.

Types of Commits and Examples

  1. feat:
  • Use this prefix when introducing a new feature or functionality to the project
  • Example: UADS-18 feat: Implemented login functionality
  1. fix:
  • Use this prefix when addressing a bug or issue in the codebase.
  • Example: UADS-31 fix: Fixed login functionality
  1. docs:
  • Use this prefix when making changes or additions to documentation, such as README files or code comments.
  • Example: UADS-2 docs: Updated README file
  1. style:
  • Use this prefix when making cosmetic changes to the codebase such as formatting, indentation or anything CSS related
  • Example: UADS-58 stlye: Formatted code in about page
  1. refactor:
  • Use this prefix when restructuring or optimizing existing code without changing its external behavioral such as renaming variables
  • Example: UADS-98 refactor: Simplified the authentication logic
  1. test:
  • Use this prefix when adding, modifying, or removing tests for the codebase.
  • Example: UADS-45 test: Added unit tests for about page
  1. chore:
  • Use this prefix for miscellaneous tasks or changes that do not fit into any other category, such as updating dependencies or configuring build tools.
  • Example: UADS-115 chore: Updateed package dependencies for backend

General Naming Conventions

PascalCase

  • Branches
  • Components
  • Controllers
  • Models
  • Pages
  • Interfaces

camelCase

  • Variables
  • Parameters
  • Functions
  • Routes
  • Images

CONSTANT_CASE

  • Global Constants
  • Enums