Validates commit messages against Conventional Commits + project-specific rules.
Pure functions — no git, no filesystem. The Mix task wraps this module to read a COMMIT_EDITMSG file and produce CLI output.
Rules applied
- Format:
<type>(<scope>)?(!)?: <subject> - Type: must be in
bump_rulesorallowed_typeswhenstrict_types: true - Scope: must be in
allowed_scopes(auto-inferred from app names + aliases when not configured) whenstrict_scopes: true - No scope: rejected when
allow_no_scope: false - Subject length:
max_subject_length, default 100
Return
:ok— valid{:error, reason}— one of::missing_header:bad_format{:unknown_type, type, allowed}{:unknown_scope, scope, allowed}:scope_required{:subject_too_long, length, max}
Summary
Functions
Humanizes an error reason for display.
Returns the list of allowed scopes, resolving from config + apps.
Validates a raw commit message string.
Functions
Humanizes an error reason for display.
Returns the list of allowed scopes, resolving from config + apps.
Validates a raw commit message string.
Returns :ok or {:error, reason}.