# commits

> Checks commit messages for a conventional type, an optional project scope, a first line of 72 characters or fewer, and a wrapped body.

Checks commit messages for a conventional type, an optional project scope, a first line of 72 characters or fewer, and a wrapped body.

## Checks

| Check                                                                       | Stage     | Level | What it does                                                                                                                              |
| --------------------------------------------------------------------------- | --------- | ----- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| [`commits/commitlint`](/reference/checks/commits/commitlint/)               | `message` | `all` | Checks a new commit message for a conventional type, an optional known scope, a first line of 72 characters or fewer, and a wrapped body. |
| [`commits/commitlint-pushed`](/reference/checks/commits/commitlint-pushed/) | `push`    | `all` | Checks the message of each commit in a push. A manual run covers every commit from the upstream merge base to HEAD.                       |

## Settings

| Setting                                                                     | What it sets                                                                                                                                                                                                                                           |
| --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [`tools.commitlint.types`](/reference/gspot-toml/#tools.commitlint.types)   | The commit types the type-enum rule allows.                                                                                                                                                                                                            |
| [`tools.commitlint.scopes`](/reference/gspot-toml/#tools.commitlint.scopes) | Commit scopes that the scope-enum rule accepts, and a message may leave out its scope. When empty, gspot uses the last segment of each project scope path, or no list without project scopes.                                                          |
| [`tools.commitlint.rules`](/reference/gspot-toml/#tools.commitlint.rules)   | Options for active commitlint rules, by rule name: an always/never condition and an optional value, without a severity; the level decides which rules run. Ignore a finding with gspot ignore commits/commitlint `--rule` `<rule>` `--reason` `<why>`. |

## Selected when

Always selected in a Git repository.

## Rules for coding agents

| Rule file                                            | Installed when |
| ---------------------------------------------------- | -------------- |
| `.gspot/configurations/general/commits/rules/GIT.md` | Always         |

## Tools and versions

| Tool       | Version  |
| ---------- | -------- |
| commitlint | `21.2.2` |

## Files gspot writes

gspot writes `.gspot/configurations/general/commits/commitlint.json`.
