Sobes.tech
Junior

How do you usually commit code?

sobes.tech AI

Answer from AI

I use a standardized commit format, often based on Conventional Commits. This ensures consistency and automates some processes, such as changelog generation.

A typical commit format:

<type>[(scope)]: <description>

[<body>]

[<footer>]
  • <type>: Required. Defines the type of change (e.g., feat for new features, fix for bug fixes, docs for documentation changes, style for formatting, refactor for refactoring, test for adding tests, ci for CI/CD changes).
  • (scope): Optional. Indicates the area of the application affected by the change (e.g., (component: button), (service: authentication)).
  • <description>: Required. A brief and precise description of the change in imperative mood (e.g., "add button", "fix validation error").
  • <body>: Optional. A more detailed explanation of the change, reasons for it, and context. Separated from the description by an empty line.
  • <footer>: Optional. Usually used to indicate BREAKING CHANGE with a description of why it breaks backward compatibility, or links to issues (e.g., Closes #123).

Examples:

feat: add modal component
fix(validation): fix email validation error in registration form

Now email is validated correctly according to RFC 5322 standard.

Closes #45
refactor(component: button): update styles and improve accessibility

Refactoring button styles to match the design system.
Improved accessibility by adding ARIA attributes.

This helps the team better understand the change history, speeds up code review, and simplifies automated processes.