Commit Message Guidelines

This document outlines the structure and requirements for commit messages in our project.

Structure

A commit message consists of three main parts: Header, Body, and Footer.

Header

  • Format: <type>(<scope/component>): <subject>

  • Details:

    • Type: Indicates the type of change being made. It must be one of the following:

      • feat: A new feature (✨)
      • fix: A bug fix (🐛)
      • docs: Documentation only changes (📚)
      • style: Changes that do not affect the meaning of the code (💎)
      • refactor: A code change that neither fixes a bug nor adds a feature (📦)
      • perf: A code change that improves performance (🚀)
      • test: Adding missing tests or correcting existing tests (🚨)
      • chore: Other changes that don't modify src or test files (♻️)
      • build: Changes that affect the build system or external dependencies (🛠)
      • ci: Changes to CI configuration files and scripts (⚙️)
      • revert: Reverts a previous commit (🗑)
    • Scope: A noun describing a section of the codebase (e.g., component or file name).

    • Subject: A short description of the change, written in imperative tense.

  • Example:

    `feat(auth): Implement user authentication system for SKypiea`

Body

Provide a longer description of the change, explaining what and why.

  • Details about what was changed, why it was changed, and how it was changed.
  • Usage: Write in the imperative mood and keep it clear and concise. Use bullet points for lists when necessary.
  • Example:
    - Added user registration, login, and logout functionality.
    - Integrated JWT for secure token-based authentication.
    - Implemented password hashing using bcrypt for enhanced security.
    - Added unit tests for authentication endpoints.

Footer

  • Breaking Changes: If there are any breaking changes, indicate them here.
  • Issue References: Reference any related issues (e.g., "fix #123").
  • Example:
    Closes ZSAAS-123, ZSAAS-124

Example

Here's an example commit message that covers all best practices:

feat(auth): Implement user authentication system for ZSAAS X
 
- Added user registration, login, and logout functionality.
- Integrated JWT for secure token-based authentication.
- Implemented password hashing using bcrypt for enhanced security.
- Added unit tests for authentication endpoints.
 
Closes ZSAAS-123, ZSAAS-124

Summary

  • Header: Short summary of the change.
  • Body: Detailed explanation of what was done and why.
  • Footer: References to issues or any additional notes (like breaking changes).