Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Rules

Each rule has a page explaining what it looks for, what it leaves alone and why it exists. The examples show the code after rafiki lint --fix followed by rafiki fmt.

RuleFlagsFix
bool-comparisonComparing with true or falseYes
collapsible-else-ifAn else block that only contains an ifYes
collapsible-ifAn if that only contains another ifYes
compound-assignmentx = x + n instead of x += nYes
ifs-same-condTwo branches of an if chain with the same conditionNo
import-orderImports that aren’t sorted and groupedMostly
naming-conventionNames that don’t follow Garmin’s coding conventionsNo
null-unionT or Null instead of T?Yes
one-class-per-fileMore than one class in a fileNo
redundant-resource-refThe legacy @ before a resource referenceYes
super-initializer-callAn initialize that doesn’t call the parent’sNo
unneeded-parensParentheses that can’t change how the code is readYes