Everduin94 / better-commits

A CLI for creating better commits following the conventional commits specification

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Title Template Property

Everduin94 opened this issue · comments

Context

Based on #69

Today, although each property is optional, the order in the title is fixed to match conventional commits.

TYPE(SCOPE): TICKET DESCRIPTION

Tasks

Create a property title_template

  • Default: type(scope): ticket description

Zod Validation

  • Enforce key words: ["type", "scope", "ticket", "description"]
  • Enforce separators: ["/", "-", "_", "[]", "()", ":", "{}"]

Regex

  • Update string builder to use template

Concerns

  • More difficult to enforce things like "if () is empty remove, if no text before colon then remove colon" etc...

Outstanding Tasks

  • This will effectively make fields like optional or separator redundant in some cases. Should we deprecate?
  • We may want to add some way to add custom fields / prompts

Closing. See #77

Solves most common situations with existing code.