Skip to main content

Lintje rules

All the rules Lintje follows are documented in this rules section. Visit the sub-pages for each type of rule. The headings on each page matches the rule names, and can be used to ignore specific rules per commit.

Lintje is primarily focussed on supporting the English language, other languages may not be compatible with every rule currently. Please create an issue if you run into any problems.

Contents

Available rule types

Read the rules pages for all the rules Lintje checks and how to fix them. For more information about why Lintje has these rules, please read the philosophy page.

There is also a list of all available rules available.

All available rules

Rule name Rule type
BranchNameCliche Error rule
BranchNameLength Error rule
BranchNamePunctuation Error rule
BranchNameTicketNumber Error rule
DiffChangeset Error rule
DiffPresence Error rule
MergeCommit Error rule
MessageEmptyFirstLine Error rule
MessageLineLength Error rule
MessagePresence Error rule
MessageSkipBuildTag Hint rule
MessageTicketNumber Hint rule
MessageTrailerLine Error rule
RebaseCommit Error rule
SubjectBuildTag Error rule
SubjectCapitalization Error rule
SubjectCliche Error rule
SubjectLength Error rule
SubjectMood Error rule
SubjectPrefix Error rule
SubjectPunctuation Error rule
SubjectTicketNumber Error rule
SubjectWhitespace Error rule

A note about Unicode display width

Not all characters render with the same display width in columns in the terminal. The a character has a width of one column, but an emoji usually is wider than one column. Lintje’s rules will count line length in characters using their display width. This means a subject can contain 50 characters like the a character, but it cannot contain 50 emoji that are two columns wide. Such an emoji heavy subject is allowed a maximum of 25 emoji for the SubjectLength rule.

Not all emoji render with the same width and may break the layout of Lintje’s output, and cause problems with rules that calculate line length. Lintje will attempt to correct the automatic width calculation of character width, but some characters may not be calculated correctly. This is a bug. Please report any characters with that break the output.

For example, by default the “Green Check Mark” emoji has a width of two, while the “Woman Scientist” emoji 👩‍🔬 has a width of four columns. This is because the second emoji is a combination of the 👩 and 🔬 emoji. Normally they would both be counted towards the width even though only one emoji is rendered. This particular scenario is calculated and rendered properly as two columns in Lintje.

The heart emoji ❤️, and similar emoji, will only count as a width of one column. This is by design. Most other (terminal) apps–in which Lintje will print its output–will also render it with a width of one column.