Command Palette

Search for a command to run...

atypical
Commit grammar

Slots

The fields that declare a commit header.

A header is a prefix of slots, one space, and a description.

feat(api)!: add an endpoint
└──┘└───┘│└ separator
 │    │  └ modifiers
 │    └ scope
 └ keywords

[[commit.slots]] lists the slots in header order.

atypical.toml
[[commit.slots]]
name = "keywords"
kind = "word"
values = ["feat", "fix"]
required = true

[[commit.slots]]
name = "scope"
delimiters = ["(", ")"]

[[commit.slots]]
name = "separator"
kind = "symbol"
values = [":"]
required = true
HeaderResult
feat: xValid
fix(parser): xValid
chore: xInvalid: chore not in values
feat xInvalid: no separator

Fields

FieldTypeDefault
namestringnone, required
kind"word", "symbols" or "symbol"none
delimiterstwo characters, such as ["(", ")"]none
one-ofarray of option slots; see One ofnone
values"any", or an array of spellings"any"
requiredbooleanfalse
gapboolean; see Spacingfalse
tightboolean; see Spacingfalse
  • A slot has exactly one of kind, delimiters or one-of.
  • name appears in messages and is the key for merging.

Kinds

KindMatches
wordA run of Unicode letters, digits and _
symbolsA run of visible characters other than word characters
symbolOne visible character other than a word character

An unrestricted symbols run stops before any delimiter opener in the grammar and before the separator that follows it. With an unrestricted separator, the last symbol of the run is the separator.

Delimited slots

valuesContents
"any"Any characters except the slot's two delimiters, spaces included
A listWord characters and -
  • A delimited slot is never empty.
  • Consecutive delimited slots each appear at most once, in declaration order.

Values

  • values restricts a slot to a closed list of spellings.
  • Each spelling must be matchable by the slot's kind; a symbol slot cannot list ::.
  • A bare slot tries longer spellings first, independent of list order.

Description

  • Separated from the prefix by exactly one space.
  • Not empty.
  • Trailing whitespace is ignored.
  • Content is not checked.

On this page