# Rules for `committed` (https://github.com/crate-ci/committed), run as a # commit-msg hook from prek.toml. # # Most lines below override a default. The overrides are what make the linter # describe the style this project actually writes, rather than rejecting it. 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. subject_capitalized = false # The defaults are 50 columns of subject and 72 of any wrapped line. Bodies # here are wrapped at 80, and the conventional `type(scope)!: ` prefix eats ten # to twenty columns before the description even 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` covers changes to # the workspace layout and the hook configuration, and `chore` is what # cargo-release writes for the version commit (see release.toml), so without it # the bump command could not commit through its own hook. `ci` and `revert` are # here to complete the conventional set. 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. The scopes here track the crate # layout, which is still moving. 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`) 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, 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. A trailing full stop is rejected; inline # punctuation is fine. # # 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 here does.