Skip to content
Versora

Manual

Commits

Conventional Commits

12 min read

On this page

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.yml and policy), which don't let you commit outside the standard.

Conventional mode in the commit box

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.

Where to find it

  • 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.

Step by step

  1. Click Conventional at the top of the commit box.
  2. In Type (the field shows "type…"), choose the type of change, for example feat — A new feature.
  3. 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.
  4. In Short description ("short description (e.g. allow signing in with Google)"), write what the commit does.
  5. Watch the summary being built: feat(login): allow signing in with Google.
  6. If the change breaks things for whoever uses the code, check Breaking change (see the next section).
  7. Write the description, if you want, and commit as usual.
OptionWhat it doesDefault
Free-form / ConventionalSwitches the box's mode. The choice is remembered per repositoryFree-form
TypeList 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…")
ScopeFree 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 descriptionThe 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):

TypeDescription in the selector
featA new feature
fixA bug fix
docsDocumentation only
styleFormatting, no change in behavior
refactorRestructuring that neither adds a feature nor fixes a bug
perfA performance improvement
testAdding or fixing tests
buildBuild system or dependencies (npm, cargo, maven…)
ciContinuous integration (pipelines)
choreMaintenance that doesn't touch production code
revertReverts a previous commit

With no type and no scope, the summary is just the short description (free text).

What Versora does in git

Conventional mode only builds the text. The scope suggestions come from the history:

bash
git log --max-count=2000 --format=%s

The commit is the usual git commit -F - (see The commit box).

How to undo

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.

Caveats and messages

  • 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.

See also

Breaking change

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.

Where to find it

  • Commit box, in Conventional mode › Breaking change.

Step by step

  1. In Conventional mode, check Breaking change. The ! goes into the summary right away: feat(api)!: remove the legacy field.
  2. To remove the ! and keep only the footer, uncheck Mark with "!" in the summary (tooltip: "Adds "!" before the colon: feat(api)!: …").
  3. 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 line BREAKING CHANGE: the oldName field was removed; use name.
  4. Commit.
OptionWhat it doesDefault
Breaking changeOpens the options below. It's checked on its own when the summary already has ! or the description already has the footerUnchecked
Mark with "!" in the summaryAdds or removes the ! before the colonChecked when you turn on the breaking change
Breaking change noteThe text of the BREAKING CHANGE: footerEmpty

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.

What Versora does in git

Nothing extra: the ! and the footer go into the commit message.

How to undo

Uncheck Breaking change: the ! leaves the summary and the footer leaves the description. Deleting the note's text also removes the footer.

Caveats and messages

  • 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 and git interpret-trailers keep 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 !.

See also

Validation by the repository's commitlint

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.

Where to find it

  • 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".

Step by step

  1. Open the repository. If there's a commitlint configuration, the commitlint chip shows up in the commit box.
  2. Write the message. A moment after you stop typing, the box shows the problems: errors and warnings, up to three at a time.
  3. 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.
  4. Fix the message, or go ahead with Commit anyway. If the repository is set to block, only Fix the message (see the next section).
  5. 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:

FilesHow the app reads them
.commitlintrc, .commitlintrc.json, .commitlintrc.yaml, .commitlintrc.yml and the commitlint key in package.jsonIn full (JSON and YAML)
.commitlintrc.js, .cjs, .mjs, .ts, .cts and commitlint.config.js, .cjs, .mjs, .ts, .cts, .mtsThey 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-conventional and @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-empty and signed-off-by.
  • Unknown rules are never treated as passed: they show up as "not checked".
  • ignores, plugins and parserPreset aren't evaluated. Merge, revert, fixup! and squash! are exempt, as in commitlint (unless defaultIgnores: 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".

What Versora does in git

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).

How to undo

Validation doesn't record anything. If you went ahead with Commit anyway, the commit is undone with Ctrl+Z, like any commit.

Caveats and messages

  • "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:text without the space.
  • Preferences › Versions and commits (commitlint group, read-only).
  • To change the rules, edit the commitlint configuration in the repository and commit it.

See also

Require Conventional Commits and block messages with errors

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.

Where to find it

  • 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.

Step by step

  1. Open the repository in a tab and go to Preferences › Versions and commits.
  2. Under Require Conventional Commits, turn on Require in this repository.
  3. If you want an error to prevent the commit, also turn on Block messages with errors › Block the commit.
  4. Go back to the commit box: the required chip shows up next to the mode selector, and the message is checked while you write.
OptionWhat it doesDefault
Require Conventional Commits › Require in this repositoryChecks 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 applyOff
Block messages with errors › Block the commitWithout 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 warnOff
Structured commit box › Use structured modeTurns on Conventional mode in this repository's commit boxOff

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).

What Versora does in git

Nothing in git. The choices are saved in the app, per repository.

How to undo

Turn the options off. They don't change commits already made.

Caveats and messages

  • "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! and amend! messages are exempt.
  • Preferences › Versions and commits. The company policy can make the page read-only.

See also

Conventional Commits required by the team or the company

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.

Where to find it

  • 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.

Step by step

  1. Write the message following the standard (Conventional mode helps).
  2. 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.".
  3. 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.
RuleWhere it's setEffect
Conventional Commits required.versora.yml: commit.conventional: true; company: commit_conventional: requiredThe title must have a type and a description
Allowed types.versora.yml: commit.types: [feat, fix, docs]; company: commit_typesThe 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.

What Versora does in git

Nothing in git: the check is done by the app, before git commit.

How to undo

There's nothing to undo: a message outside the rules never gets committed.

Caveats and messages

  • 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.

See also