git_commit_no_fixup
Fail on residual fixup! / squash! / amend! commits left in scope — the ones git commit --fixup / --squash produce, meant to be collapsed by git rebase --autosquash before merging. Forgetting to rebase is the universal case; this rule catches the leftover so it doesn’t land on the main branch.
No configuration knobs — the matched subject prefixes are exactly what --autosquash understands. Shares the commit-validation family’s since: / include_merges: semantics and failure modes.
Options
Section titled “Options”| Option | Type | Required | Default | Description |
|---|---|---|---|---|
include_merges | boolean | false | When validating a range (since: set), include merge commits. Has no effect when since: is unset; combining include_merges: true with no since: is a load-time error. | |
since | string | null | Git ref to use as the base of the commit range. When set, validates every commit in <since>..HEAD instead of just HEAD. Accepts anything git rev-parse does. Use the canonical {{env.X}} interpolation to pass a SHA via an env var, e.g. since: "{{env.ALINT_BASE_SHA | default('origin/main')}}". |
Plus the common level, id, and when fields. This rule analyses the whole repository, so it takes no paths. This table is generated from the JSON Schema; option types and defaults are authoritative.
Example
Section titled “Example”A leftover fixup! commit never autosquashed
Section titled “A leftover fixup! commit never autosquashed”The rule fires on this repository:
README.md# demoWith this .alint.yml:
version: 1rules: - id: no-fixup kind: git_commit_no_fixup level: errorcommitted with this history (oldest first):
2024-01-15T09:00:00+00:00 fixup! feat: the original changealint check reports:
--- Repository-level ----------------------------------------------------------- x error no-fixup commit 8f408e3: is a fixup/squash/amend commit; rebase with `--autosquash` before merging (subject: "fixup! feat: the original change")
Summary (1 violation): x 1 error 0 passing * 1 failingA normal commit with no leftover fixup
Section titled “A normal commit with no leftover fixup”This repository is compliant:
README.md# demoWith this .alint.yml:
version: 1rules: - id: no-fixup kind: git_commit_no_fixup level: errorcommitted with this history (oldest first):
feat: a normal changealint check reports:
v All 1 rule(s) passed.