pre-commit git gitlint
- Journal 2024-12-05 Commitizen
- ConventionalCommits.org
-
Gitlint
.gitlint:[general] ignore = body-is-missing contrib = contrib-title-conventional-commits
.pre-commit-config.yaml:- repo: https://github.com/jorisroovers/gitlint rev: v0.19.1 hooks: - id: gitlint stages: [commit-msg] -
Install the
commit-msghook:pre-commit install --hook-type commit-msg -
To enable
gitlintin vim ALE - Asynchronous Lint Engine,uv tool install gitlint-core --with gitlint.gitlintalone does not provide the command line interface foruvto expose, andgitlint-corelacks the default optional content. -
The Initial Commit generated by
Pyscaffoldprovides an easy check thatgitlintworks directly and viapre-commit.# 1: CT1 Title does not follow ConventionalCommits.org format # 'type(optional-scope): description': "Initial commit" pre-commit run --hook-stage commit-msg \ --commit-msg-filename .git/COMMIT_EDITMSG cat .git/COMMIT_EDITMSG | gitlint