Rules
Each lint rule walks the parsed AST looking for a specific pattern. When a rule
fires it produces a Diagnostic — the source range, a message,
and (when applicable) a machine-applicable Fix that replaces a byte
range with new text.
Fixes are byte-level text replacements, not AST rewrites. That means a fix only
touches the affected source range and leaves the surrounding formatting alone.
Once --fix has been applied the user is expected to run
rafiki fmt if they want whitespace normalised.
Categories
| Rule | Auto-fix | Notes |
|---|---|---|
bool-comparison | ✅ | Rewrites x == true as x, x == false as !x |
collapsible-else-if | ✅ | Rewrites else { if … } as else if … |
collapsible-if | ✅ | Merges a nested if with &&; skipped when comments intervene |
compound-assignment | ✅ | Rewrites x = x + n as x += n |
ifs-same-cond | ❌ | Checks for consecutive ifs with the same condition |
import-order | ⚠️ | Suppressed when comments interleave |
naming-convention | ❌ | Naming convention according to Coding Conventions |
one-class-per-file | ❌ | Only allow one class per file according to Coding Conventions |
redundant-resource-ref | ✅ | Drops legacy @ on Rez.* refs |
super-initializer-call | ❌ | Flags missing Base.initialize(…) Coding Conventions |
unneeded-parens | ✅ | Removes redundant parentheses |