> ## Documentation Index
> Fetch the complete documentation index at: https://docs.talosjs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# commitlint:check

> Validate a commit message file against the project's conventional-commit rules.

Lints a commit message file against the project's conventional-commit rules and exits non-zero — which aborts the commit — when the message is invalid, printing the specific violations. This is the command the [`commitlint:init`](/cli/commands/commitlint-init) `commit-msg` hook runs on each commit; you rarely invoke it directly.

## Usage

```bash theme={null}
talos commitlint:check --file <commit-message-file>
```

## Examples

Validate the message git is about to commit, exactly as the hook does:

```bash theme={null}
talos commitlint:check --file .git/COMMIT_EDITMSG
```

## Options

| Option   | Description                                  | Default  |
| -------- | -------------------------------------------- | -------- |
| `--file` | Path to the commit message file to validate. | Required |

## Rules

A message must take the form `type(scope): Subject`:

* **type** — one of `build`, `chore`, `ci`, `docs`, `feat`, `fix`, `perf`, `refactor`, `revert`, `style`, `test`, in lower-case.
* **scope** — required and lower-case, and either `common` or the name of a package or module directory in the workspace. Scopes are discovered automatically, so a new module or package is a valid scope with no config change. Multiple scopes are allowed (`feat(app, shared): ...`).
* **subject** — non-empty, starts with an upper-case letter, and does not end with a period. The whole header must be 100 characters or fewer.

Merge, revert, and autosquash (`fixup!`/`squash!`) messages are skipped. Install the hook that runs this check with [`commitlint:init`](/cli/commands/commitlint-init).
