Skip to main content

Commit Validation

Commit Validation

Active

Keep commit validation available in every project while enabling Commitizen only when the project intentionally adopts it.

Command[tool.custy.commit.validation]

Category

Configuration

Quick Command

provider = auto | custy | commitizen | git

provider selectionoptional CommitizenGit hooks

.config/custy/config.toml
toml
[tool.custy.commit.validation]
provider = "auto"
require_tool = false

This default does not require Commitizen. Custy activates cz only when it finds both recognized project configuration and an available executable.


Behavior Matrix

ProviderCommitizen configcz installedResult
autoNoNoUse Custy validation.
autoNoYesUse Custy validation; installation alone does not activate Commitizen.
autoYesYesRun Custy validation, then Commitizen validation.
autoYesNoWarn and fall back to Custy.
auto with require_tool = trueYesNoStop before mutation with COMMITIZEN_NOT_AVAILABLE.
custyAnyAnyUse only Custy's built-in conventional-message rules.
commitizenYesYesRequire both Custy and Commitizen validation.
commitizenNo or invalidAnyStop before mutation with a focused configuration error.
gitAnyAnyRequire a readable, non-empty UTF-8 message file; allow project-specific message formats.

Properties

Properties

PropertyTypeDescriptionDefaultRequired
providerauto | custy | commitizen | gitSelect automatic discovery, Custy's internal rules, strict Commitizen integration, or basic Git message-file safety checks.autoNo
require_toolBooleanIn auto mode, turn a detected invalid or unavailable Commitizen integration from a warning and fallback into an early error.falseNo

What Auto Detects

Custy recognizes these project configuration sources:

  • .cz.toml
  • .cz.yaml or .cz.yml
  • .cz.json
  • [tool.commitizen] in pyproject.toml

Custy separately checks whether the cz executable is available. It never installs Commitizen during a command and never enables it only because the executable happens to be installed globally.


CLI Override

--check-cz is the backward-compatible strict override. For that invocation, it behaves like:

Terminal
toml
provider = "commitizen"
require_tool = true

Use persistent TOML configuration for team policy. Use --check-cz for an intentional one-time verification.


Install Optional Commitizen Support

Terminal
bash
pip install "custy[commitizen]"

Custy's production Docker image includes this optional extra so supported Commitizen workflows are available in the container. A project-specific pre-commit installation remains separate.


Versioning and Message Validation Are Independent

[tool.custy.cli.versioning].strategy = "commitizen" asks Commitizen to help resolve versions. [tool.custy.commit.validation].provider = "commitizen" asks it to validate the final commit message. A project may enable either one, both, or neither.

Continue