Rules
Every rule is one principle from one article. fmt fixes the sorting
family; check reports all of them. Levels are the defaults; every one can
be changed in rabot.toml.
| Rule | Level | Fix | Principle |
|---|---|---|---|
| sorted-fields | warn | fmt | Sort everything |
| sorted-variants | warn | fmt | Sort everything |
| sorted-impl-items | warn | fmt | Sort everything |
| sorted-trait-items | warn | fmt | Sort everything |
| sorted-struct-literal | warn | fmt | Sort everything |
| sorted-struct-pattern | warn | fmt | Sort everything |
| sorted-derives | warn | fmt | Sort everything |
| primitive-soup | warn | Wrap your primitives | |
| primitive-field | warn | Wrap your primitives | |
| stringly-typed-field | warn | Wrap your primitives | |
| bypassable-constructor | warn | Validate once, at construction | |
| boolean-validation | warn | Treat errors as data | |
| free-function | warn | Put behavior on the type it belongs to | |
| vague-type-name | warn | Name what you built | |
| orphan-module | warn | Name what you built | |
| oversized-impl | warn | Obsess over your data structures | |
| too-many-parameters | warn | Obsess over your data structures | |
| panic-in-production | warn | Treat errors as data | |
| untyped-error | warn | Treat errors as data | |
| swallowed-error | warn | Treat errors as data | |
| dropped-error-context | warn | Treat errors as data | |
| escape-hatch-variant | warn | Treat errors as data | |
| global-state | warn | Dependencies in the signature | |
| ambient-config | warn | Dependencies in the signature | |
| mock-usage | warn | Real implementations, not mocks | |
| ignored-test | warn | Write down every exception | |
| ambient-time | warn | Make the clock injectable | |
| ambient-randomness | warn | Make the clock injectable | |
| sleep-in-tests | warn | Fast and honest tests | |
| commented-out-code | warn | Delete the comment, fix the code | |
| vague-todo | warn | Delete the comment, fix the code | |
| sectioned-function | warn | Delete the comment, fix the code | |
| undocumented-exception | error | Write down every exception | |
| unknown-rule | error | Write down every exception | |
| syntax-error | error |
rabot rules prints the same table in the terminal; rabot explain <rule>
prints a rule’s page.