Skip to content

validate-commit-msg: enforce types/scopes/refs by default #58

Closed

Description

@gerchowl

cc @c-vigo

Suggestion: validate-commit-msg should ship with types, scopes, and refs enforced by default (strict-by-default) instead of being opt-in via commented-out CLI args.

Why: Users won't discover commented-out config. If enforcement is on by default, they experience the value immediately. The pre-commit error message can link to .pre-commit-config.yaml with a "customize or disable" hint — easy opt-out beats invisible opt-in.

TL;DR: Default strict → show config path in error → users discover greatness, can relax if needed.

Ref: .pre-commit-config.yaml lines 120–126.

Activity

  1. c-vigo commented on Feb 18, 2026

    @c-vigo
    Contributor

    I agree on enforced types, but not so much on scopes since they can be very project-dependent, and there is even a question to be made whether they are useful or not.

    Currently we use:

      # Commit message validation (commit-msg stage)
      - repo: local
        hooks:
          - id: validate-commit-msg
            name: validate commit message
            entry: uv run validate-commit-msg
            language: system
            stages: [commit-msg]
            args: [
              "--types", "feat,fix,docs,chore,refactor,test,ci,build,revert,style",
              "--scopes", "setup,image,vigutils",
              "--refs-optional-types", "chore",
            ]
  2. gerchowl commented on Feb 18, 2026

    @gerchowl
    ContributorAuthor

    I'd say so, i.e. for changelog generation/grouping and, yes, scopes one could do some generic (or even have them auto populated based on codebase/project analysis / AST .. :-D)

  3. self-assigned this
    on Feb 18, 2026
  4. added
    priority:medium
    area:workflow
    effort:small
    semver:minor
    and removed on Feb 18, 2026
  5. added this to the 0.3 milestone on Feb 18, 2026
  6. added
    feature
    on Feb 18, 2026
  7. c-vigo commented on Feb 19, 2026

    @c-vigo
    Contributor

    Solved in e27722c

  8. added a commit that references this issue on Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:workfloweffort:smallfeaturepriority:mediumsemver:minor

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions