# Rules for `committed` (https://github.com/crate-ci/committed), run as a # commit-msg hook from prek.toml. # # Nearly every line below overrides a default, which looks like fussing until # you run the defaults against this repo: with a bare `style = "conventional"` # and nothing else, all 35 conforming commits since 5f7d819 fail. With the # settings below, all 35 pass and the pre-5f7d819 prose subjects still fail. # That is the test this file was written against — a linter that rejects the # history it is meant to describe is a linter that gets uninstalled. style = "conventional" # committed capitalizes the subject by default, which for a conventional commit # means requiring `feat(auth): Leave the active account alone`. This project # writes the description in lower case. This one default is what failed all 35. subject_capitalized = false # The defaults are 50 columns of subject and 72 of any wrapped line. The # longest subject in the conforming range is 77 — # fix(http): bound every request, so an unreachable host cannot stall a command # — and bodies here are wrapped at 80. So 80 is the limit that already exists; # 50 is a limit that the whole history violates, and one of those is a rule and # the other is a lie. Note that the conventional `type(scope)!: ` prefix eats # 10-20 columns before the description starts, which is most of why 50 does not # fit. subject_length = 80 line_length = 80 # The default list is fix, feat, chore, docs, style, refactor, perf, test. Two # additions are load-bearing rather than speculative: `build` is already in the # history (build: keep the whitespace fixers off captured fixtures), and `chore` # is what cargo-release writes for the version commit (see release.toml), so # without it the bump command cannot commit through its own hook. `ci` and # `revert` are here to complete the conventional set, and are unused so far. allowed_types = [ "feat", "fix", "docs", "style", "refactor", "perf", "test", "build", "ci", "chore", "revert", ] # Left at their defaults, deliberately: # # allowed_scopes — unset, so any scope passes. Twelve are in use (auth, authlog, # account, bobbin, http, identity, models, pr, repo, resolve, review, # sessions) and they track the module layout, which still moves. Pinning the # list would mean a rename could only land by editing this file first. # # imperative_subject — true, and worth knowing it is a wordlist heuristic, not # grammar, and an uneven one. It rejects a description opening with an # article (`fix: a fix for it`, `fix: the thing`) and some inflected verbs # (`adds`, `added`); it passes `corrects it`, `correcting it` and non-verb # openings like `how it works`. Kept on because the forms it does catch are # ones people type, and because every subject in the conforming history # survives it, but it is a nudge and not a guarantee. If it ever rejects a # subject that is genuinely imperative, that is the bug, and this is the knob. # # subject_not_punctuated — true. Trailing `.` is rejected; inline punctuation is # fine, including the asterisks in # `fix(review): read the record the appview page is *about*`. # # no_wip, no_fixup — true. Both are aimed at a branch that is about to be # rebased anyway, and this project rebases. # # merge_commit — true, and inert here. In commit-msg mode committed is handed a # message file with no parent information, so it cannot tell a merge from # anything else. The rule only bites when committed is run over a commit # range, which nothing in this repo does.