git_lint_commits
Deterministically validate commit messages against guidelines—no AI, network, or credentials needed. Lint a single message or a commit range, enforcing format, style, and footer rules with a YAML pass/fail report.
Instructions
Deterministically validate commit messages against guidelines — no AI, no network, no credentials required (unlike git_check_commits, which calls an AI model). Checks: type/scope format, scope membership in scopes.yaml, subject length, lowercase/no-trailing-period style, blank line after the subject when a body is present, and forbidden footers. Does NOT check type-matches-diff, scope-file-correspondence, or description truthfulness — those need a model and stay in git_check_commits. Set message to lint a single literal message directly (bypassing git entirely), or range to lint every non-merge commit in a range (defaults to commits ahead of the base branch). Mirrors omni-dev git commit message lint. Returns a YAML payload with the full CheckReport, a pass/fail summary, and the exit code the CLI would use (honouring strict).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| range | No | Commit range to lint (e.g., `HEAD~3..HEAD`, `abc123..def456`). Defaults to commits ahead of the default base branch when omitted (unlike `git_check_commits`, which requires `range`). | |
| strict | No | When true, warnings are treated as non-zero exit conditions. Defaults to `false` (only errors fail). | |
| message | No | Lint this literal message directly instead of a commit range (the `--stdin` equivalent) — no git repository is touched. Exactly one of `range`/`message` should be set; `message` takes precedence if both are. | |
| repo_path | No | Path to the git repository. Defaults to the current working directory. Ignored when `message` is set. | |
| context_dir | No | Optional explicit context directory (overrides the standard `.omni-dev/` resolution chain for both `scopes.yaml` and `commit-rules.yaml`). |