Branch naming
branch_naming
Branch naming convention for ticket-driven workflows.
CONVENTIONAL_COMMIT_FORMAT = '<type>[(scope)][!]: <description>'
module-attribute
Human-readable expected Conventional Commit summary format.
branch_name_from_ticket(ticket_id, title, labels)
Build a deterministic branch name from ticket metadata.
Produces names in the format <type>/<TICKET_ID>-<slug> where
type is derived from the ticket labels.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ticket_id
|
str
|
Ticket identifier (e.g. |
required |
title
|
str
|
Ticket title used to generate the slug. |
required |
labels
|
list[str]
|
Ticket labels used to determine the branch type. |
required |
Returns:
| Type | Description |
|---|---|
str
|
A URL-safe branch name. |
Source code in packages/axm-git/src/axm_git/core/branch_naming.py
is_conventional_commit(message)
Return whether message matches the Conventional Commit format.
A message is conventional when it starts with type: or
type(scope): (an optional breaking ! marker is allowed before
the colon, e.g. feat!: or fix(scope)!:) followed by a space.
This is the single source of truth shared by branch-type inference
and the git_commit validation path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
str
|
Commit summary line to validate. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
|
Source code in packages/axm-git/src/axm_git/core/branch_naming.py
slugify(title, *, max_len=40)
Convert a title string into a URL-safe slug.
Lowercases the input, replaces non-alphanumeric characters with hyphens, collapses consecutive hyphens, and strips leading/trailing hyphens.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title
|
str
|
The title to slugify. |
required |
max_len
|
int
|
Maximum length of the slug (default 40). Truncation prefers word boundaries when possible. |
40
|
Returns:
| Type | Description |
|---|---|
str
|
A sanitized slug, or |
str
|
contains only special characters. |