Skip to content

pre-commit hook does not check/support custom types (defined in config.commitizen.types) #481

Closed

Description

@stavros-mobal

Description

As there is the possibility to override types in config.commitizen.types, the pre-commit hook should take these into account as well.

Steps to reproduce

  1. Add custom types in config.commitizen.types
  2. Write & commit a commit message with the aforementioned custom types

Current behavior

pre-commit hook should exit with Passed

Desired behavior

pre-commit hook exits with Failed

Activity

  1. Lee-W commented on Aug 21, 2022

    @Lee-W
    Member

    Hi @stavros-mobal , I'm a bit confused. We do not have module config.commitizen.types. Could you please clarify a bit more?

  2. bearomorphism commented on May 9, 2026

    @bearomorphism
    Collaborator

    Triage from #1964: Still in wait-for-response since 2022. Could anyone confirm if this still reproduces on 4.15.1? cz check should respect the active rule's schema_pattern, which for cz_conventional_commits is built from the configured types. Closing as stale unless we get a fresh repro.

  3. bearomorphism commented on May 9, 2026

    @bearomorphism
    Collaborator

    Verification update (re #1964)

    Reproduced against current master (4.15.1) — and good news: this works correctly now.

    Test A — cz_conventional_commits:

    • cz check --message "feat: test" → Commit validation: successful! (exit 0)
    • cz check --message "wip: work in progress" → fails (exit 14, as expected — wip isn't a standard type)

    Test B — cz_customize with schema_pattern = "^(feat|fix|wip|chore): (.*)$":

    • cz check --message "wip: work in progress" → Commit validation: successful! (exit 0)

    So cz check does respect custom types defined via cz_customize's schema_pattern.

    Verdict: FIXED / NOT REPRODUCIBLE. The original 2022 report didn't include enough config detail to determine exactly what they tried, but on current master, both stock and customized commit-type validation work as expected. Closing-eligible unless someone can produce a fresh repro.

  4. bearomorphism commented on May 9, 2026

    @bearomorphism
    Collaborator

    Closing as fixed / not reproducible: cz_customize schema_pattern is honored by cz check. See verification comment above. Please reopen with a fresh repro on 4.15.1+ if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions