コンテンツへスキップ
Latchkey

commitlint とは?

commitlint は、コミットメッセージをルール、通常は conventional commit フォーマットに照らして検証し、メッセージが準拠しない場合に失敗するlinterです。ローカルではhookとして、CIではチェックとして実行されます。自動バージョニングやchangelogが依存する構造化されたコミットメッセージを強制します。

なぜ重要か

コミットメッセージを読み取るリリース自動化は、それらのメッセージが規約に従っている場合にのみ機能します。commitlint はそれをコミット時点で強制するため、履歴がパース可能なまま保たれます。ローカルのhookとCIのチェックの両方として実行することで、違反がmainブランチに到達する前に検出できます。

よくある質問

What is commitlint?
commitlint is a linter that validates commit messages against rules, typically a conventional commit format, and fails when a message does not conform. It runs as a hook locally or as a check in CI. It enforces the structured commit messages that automated versioning and changelogs depend on.
Why does commitlint matter in CI/CD?
Release automation that reads commit messages only works if those messages follow the convention. commitlint enforces that at commit time, so the history stays parseable. Running it both as a local hook and a CI check catches violations before they reach the main branch.

関連ガイド