Commits
Conventional Commits
12 min read
The Conventional Commits standard writes the summary as type(scope): description, for example
feat(login): allow signing in with Google. It keeps the history readable and makes it possible
to work out the next version and generate the changelog from the commits.
In Versora, the standard shows up in three places:
- in the commit box's Conventional mode, which builds the summary from fields;
- in message validation, by the rules of the repository's commitlint or by the requirement you turn on for the repository;
- in the team and company rules (
.versora.ymland policy), which don't let you commit outside the standard.
In Conventional mode, the commit box gets the Type, Scope and Short description fields, and the summary is built from them. The summary is still the source of truth: the fields are read from it on every change and write into it. Editing the summary by hand also updates the fields.
- Commit box › the Free-form | Conventional selector, at the top of the box. The tooltip on Conventional says "Builds the summary in the Conventional Commits format: type(scope): description".
- Palette (Ctrl+P): "Commit box: Conventional Commits mode" (and, in Conventional mode, "Commit box: free-form mode").
- Preferences › Versions and commits › Structured commit box › Use structured mode.
- Click Conventional at the top of the commit box.
- In Type (the field shows "type…"), choose the type of change, for example feat — A new feature.
- In Scope, write the part of the system affected, for example
login. The suggestion list brings the scopes allowed by commitlint or, without them, the scopes already used in the repository. - In Short description ("short description (e.g. allow signing in with Google)"), write what the commit does.
- Watch the summary being built:
feat(login): allow signing in with Google. - If the change breaks things for whoever uses the code, check Breaking change (see the next section).
- Write the description, if you want, and commit as usual.
| Option | What it does | Default |
|---|---|---|
| Free-form / Conventional | Switches the box's mode. The choice is remembered per repository | Free-form |
| Type | List of types. With type-enum in commitlint, its types are listed; otherwise, the 11 default types below. A type written by hand that isn't on the list shows up as "chore2 — not in the list" | Empty ("type…") |
| Scope | Free text with suggestions. Spaces and parentheses are removed. The field shows "scope (optional)" or, when commitlint requires a scope, "scope (required)" | Empty |
| Scope suggestions | "Scopes allowed by commitlint" (scope-enum) or "Scopes already used in this repository" (from the last 2000 commits) | Automatic |
| Short description | The text after type(scope): | Empty |
The default types, in the selector's order (the type name stays in English in every language; only the description changes):
| Type | Description in the selector |
|---|---|
feat | A new feature |
fix | A bug fix |
docs | Documentation only |
style | Formatting, no change in behavior |
refactor | Restructuring that neither adds a feature nor fixes a bug |
perf | A performance improvement |
test | Adding or fixing tests |
build | Build system or dependencies (npm, cargo, maven…) |
ci | Continuous integration (pipelines) |
chore | Maintenance that doesn't touch production code |
revert | Reverts a previous commit |
With no type and no scope, the summary is just the short description (free text).
Conventional mode only builds the text. The scope suggestions come from the history:
git log --max-count=2000 --format=%s
The commit is the usual git commit -F - (see The commit box).
Switching from Conventional to Free-form doesn't delete anything: the summary stays as it is. To go back to the previous text, edit the summary.
- While you write, the box lists up to three problems with the message (for example "The type is missing (feat, fix…)") and "… and 2 more" when there are others. Hover over a problem to see the rule ("rule type-empty"). This only happens when the repository has commitlint or requires the standard (see the sections below).
- Conventional mode doesn't enforce anything by itself. Validation is what decides whether the message goes through.
- Preferences › Versions and commits › Structured commit box.
A breaking change is one that forces whoever uses the code to change something. In Conventional
Commits it's marked with ! before the colon (feat(api)!: …), with a BREAKING CHANGE: … footer
in the description, or with both. When the version is worked out, it bumps the major version.
- Commit box, in Conventional mode › Breaking change.
- In Conventional mode, check Breaking change. The
!goes into the summary right away:feat(api)!: remove the legacy field. - To remove the
!and keep only the footer, uncheck Mark with "!" in the summary (tooltip: "Adds "!" before the colon: feat(api)!: …"). - In the "what breaks and how to migrate (BREAKING CHANGE: footer)" field, explain the change, for
example
the oldName field was removed; use name. The description gets the lineBREAKING CHANGE: the oldName field was removed; use name. - Commit.
| Option | What it does | Default |
|---|---|---|
| Breaking change | Opens the options below. It's checked on its own when the summary already has ! or the description already has the footer | Unchecked |
| Mark with "!" in the summary | Adds or removes the ! before the colon | Checked when you turn on the breaking change |
| Breaking change note | The text of the BREAKING CHANGE: footer | Empty |
The footer goes at the end of the description: together with the other footers, if the last paragraph is already made of footers; otherwise, after a blank line. If the description already had the footer, it's replaced in the same place.
Nothing extra: the ! and the footer go into the commit message.
Uncheck Breaking change: the ! leaves the summary and the footer leaves the description.
Deleting the note's text also removes the footer.
- When the box is emptied (after a commit, for example), the breaking change marking doesn't carry over to the next message.
- Co-authors chosen afterwards go into a paragraph of their own, after the
BREAKING CHANGE:footer. That way GitHub andgit interpret-trailerskeep recognizing the co-authors (see Co-authors). - "The "!" before the colon isn't accepted here; use the BREAKING CHANGE: footer": the
repository's commitlint doesn't accept the
!.
If the repository has a commitlint configuration, Versora reads its rules and checks the message while you write and before each commit. That way you don't find out about the problem only in the commitlint hook or in the pipeline.
- Commit box › the commitlint chip next to the mode selector. The tooltip says "Messages checked against the rules in commitlint.config.js — click to see them"; clicking it opens Preferences › Versions and commits.
- Preferences › Versions and commits › commitlint group: the file that was read and the table of rules.
- Palette (Ctrl+P): "Preferences: versions and commits".
- Open the repository. If there's a commitlint configuration, the commitlint chip shows up in the commit box.
- Write the message. A moment after you stop typing, the box shows the problems: errors and warnings, up to three at a time.
- Commit. If there are still problems, the "Before committing" dialog lists each one, in the "Commit message (commitlint.config.js rules)" group, with "rule type-enum (error)" or "rule header-max-length (warning)" below.
- Fix the message, or go ahead with Commit anyway. If the repository is set to block, only Fix the message (see the next section).
- To see what the app understood from the configuration, click the chip: the table shows each rule, the configured value and whether the app checks it.
Where the app looks for the configuration, at the root of the repository:
| Files | How the app reads them |
|---|---|
.commitlintrc, .commitlintrc.json, .commitlintrc.yaml, .commitlintrc.yml and the commitlint key in package.json | In full (JSON and YAML) |
.commitlintrc.js, .cjs, .mjs, .ts, .cts and commitlint.config.js, .cjs, .mjs, .ts, .cts, .mts | They aren't executed: the app reads the text and understands the values written directly (strings, numbers, lists). A rule with a variable, function, require or spread (...) is ignored and shows up as not checked |
What else is worth knowing:
extends: only@commitlint/config-conventionaland@commitlint/config-angular, with the rules built into the app (equivalent to version 19). Other packages aren't read.- Rules checked: type (
type-enum,type-case,type-empty…), scope (scope-enum,scope-case,scope-empty…), description (subject-case,subject-full-stop,subject-max-length…), summary (header-max-length,header-trim), body and footer (blank line, line width),references-emptyandsigned-off-by. - Unknown rules are never treated as passed: they show up as "not checked".
ignores,pluginsandparserPresetaren't evaluated. Merge, revert,fixup!andsquash!are exempt, as in commitlint (unlessdefaultIgnores: false).
In the table in Preferences › Versions and commits, the columns are Rule, Setting and In the app. The setting shows the level ("off", "warning", "error"), "never" for inverted rules, the value and "computed in JavaScript" when the value depends on code. The In the app column says "checked" or "not checked".
Nothing in git: the app reads the configuration files and checks the message text. The commitlint
hook, if installed, keeps running on git commit (unless you check Skip Git hooks).
Validation doesn't record anything. If you went ahead with Commit anyway, the commit is undone with Ctrl+Z, like any commit.
- "Configuration read from commitlint.config.js, which extends @commitlint/config-conventional." and "The app checks 12 rules before each commit.": what the app understood.
- "The app doesn't know the rule x-custom (the commitlint hook, if installed, still applies).": the app doesn't check that rule.
- "No commitlint configuration in this repository (.commitlintrc*, commitlint.config.* or the "commitlint" key in package.json).": there's nothing to read.
- "The commitlint configuration couldn't be read: …" (on the chip, which turns red) and "Couldn't read …" (in Preferences): the file has a syntax error or couldn't be opened.
- Examples of problems the box shows: "The type is missing (feat, fix…)", "The type "feature"
isn't in the allowed list: feat, fix, docs", "The scope is missing (in parentheses after the
type)", "The description after "type:" is missing", "The summary has 84 characters; the limit
is 72", "The description must be lowercase", "A body line has 120 characters; the limit is
100", "An issue reference is missing (e.g. #123 or PROJ-123)", "The "
Signed-off-by: Name <email>" line is missing". - "The message doesn't follow the "type(scope): description" format (e.g. feat(login): allow
signing in with Google). Add a space after the colon.": the summary has
feat:textwithout the space.
- Preferences › Versions and commits (commitlint group, read-only).
- To change the rules, edit the commitlint configuration in the repository and commit it.
In a repository without commitlint, you can still require the standard. And in any repository you can choose that a message with an error isn't committed, without the "Commit anyway" option. Both choices apply only to the repository and only on this computer.
- Preferences › Versions and commits › Commit messages in (repository name).
- Commit box › the required chip (tooltip: "This repository requires Conventional Commits — click to adjust"), when the requirement is on and there's no commitlint.
- Open the repository in a tab and go to Preferences › Versions and commits.
- Under Require Conventional Commits, turn on Require in this repository.
- If you want an error to prevent the commit, also turn on Block messages with errors › Block the commit.
- Go back to the commit box: the required chip shows up next to the mode selector, and the message is checked while you write.
| Option | What it does | Default |
|---|---|---|
| Require Conventional Commits › Require in this repository | Checks the message before each commit: the type(scope): description format, the default types (feat, fix, docs…) and the summary length from Preferences › Commit. With commitlint in the repository, its rules apply | Off |
| Block messages with errors › Block the commit | Without this, problems show up in a warning with "Commit anyway". With this, an error (level 2) prevents the commit until the message is fixed; warnings still only warn | Off |
| Structured commit box › Use structured mode | Turns on Conventional mode in this repository's commit box | Off |
Without commitlint, the requirement checks:
- empty type and empty description (error);
- a type outside the 11 default types (error);
- a summary longer than the Recommended summary length (warning).
Nothing in git. The choices are saved in the app, per repository.
Turn the options off. They don't change commits already made.
- "Message breaks the rules": with blocking on and an error in the message. The dialog lists the problems and ends with "Fix the message to commit. This repository is set to block the commit when the message has an error (Preferences › Versions and commits)." The only button is Fix the message.
- Blocking comes before the checks that ask questions (secrets, protected branch): you don't make decisions in them for nothing.
- Merge, revert,
fixup!,squash!andamend!messages are exempt.
- Preferences › Versions and commits. The company policy can make the page read-only.
The team can require the standard in the repository's .versora.yml, and the company can require
it in every repository on the computer. Unlike the requirement in your preferences, these rules
have no "commit anyway": a message outside the standard isn't committed.
- Commit box › the rules strip, with "Conventional Commits" and, if present, "types: feat, fix, docs".
- Preferences › Versions and commits shows at the top "In this repository, Conventional Commits is required (team rule (.versora.yml))." (or "(set by your company)"), with See the policy in effect.
- Preferences › Policy and team: the rules in effect and where each one came from.
- Write the message following the standard (Conventional mode helps).
- While you write, the strip shows what's missing, for example "The title doesn't follow Conventional Commits (type(scope): description)." or "The type chore isn't one of the allowed ones: feat, fix, docs.".
- Commit. If the message doesn't comply, the "The message doesn't follow the rules" dialog lists what to fix, with the Fix the message button.
| Rule | Where it's set | Effect |
|---|---|---|
| Conventional Commits required | .versora.yml: commit.conventional: true; company: commit_conventional: required | The title must have a type and a description |
| Allowed types | .versora.yml: commit.types: [feat, fix, docs]; company: commit_types | The type must be on the list. Checked whenever the title has the standard's shape, even without the rule above |
When both sources set types, only the ones all of them accept apply. Conventional Commits is required if any source requires it.
Nothing in git: the check is done by the app, before git commit.
There's nothing to undo: a message outside the rules never gets committed.
- Messages that git writes (merge, revert,
fixup!…) go through without being checked. - To check the whole message (and not just the title), the team uses push rules; see Checks.