Rules
ReferenceEvery rule litany has.
Selecting rules says what the columns decide.
84 rules · 30 on by default (stable correctness, suspicious, perf) · 14 restriction (cherry-picked; outside all) · 16 nursery
| Rule | Group | Stability | Fix | Default | Finds |
|---|---|---|---|---|---|
dead-code |
suspicious | nursery | never | off | exported value unreachable from any root |
disable-all-warnings |
suspicious | stable | never | on | a warning attribute disables every warning |
eta-reducible-forwarding |
style | nursery | never | off | binding that only forwards its arguments |
ignored-result |
restriction | stable | never | off | result or option value is discarded by a wildcard binding |
invalid-function-comparison |
suspicious | stable | never | on | structural comparison with a function operand |
invalid-hashtable-key |
suspicious | stable | never | on | polymorphic Hashtbl operation on a value proved functional |
invalid-nan-comparison |
correctness | stable | never | on | comparison with nan is a compile-time constant |
manual-boolean-operator |
style | stable | sometimes | off | if with one boolean-literal branch spells an operator longhand |
manual-case-guard |
pedantic | nursery | never | off | case body that is immediately an if-then-else |
manual-eta-lambda |
style | nursery | sometimes | off | anonymous function that only forwards its parameters |
manual-format-quoting |
pedantic | nursery | sometimes | off | format literal hand-quotes %s where %S quotes and escapes |
manual-list-exists |
style | stable | never | off | recursive function that re-implements List.exists |
manual-list-filter-map |
style | stable | never | off | recursive function that re-implements List.filter or filter_map |
manual-list-fold |
style | stable | never | off | recursive function that re-implements a List fold |
manual-list-forall |
style | stable | never | off | recursive function that re-implements List.for_all |
manual-list-map |
style | stable | never | off | recursive function that hand-rolls a list map |
manual-option-bind |
style | stable | never | off | two-case option match that re-implements Option.bind |
manual-option-map |
style | stable | sometimes | off | two-case match that unwraps, transforms, and rewraps an option |
manual-option-value |
style | stable | sometimes | off | two-case match extracting an option’s value over a trivial default |
manual-record-update |
style | stable | never | off | record rebuilt field by field from one base |
manual-result-bind |
style | stable | never | off | two-case result match that re-implements Result.bind |
manual-result-map |
style | stable | sometimes | off | two-case match that transforms one result arm and rebuilds the other |
manual-temp-dir |
suspicious | stable | sometimes | on | temp file removed and re-created as a directory |
manual-tuple-matching |
style | stable | sometimes | off | single irrefutable tuple case that could be a let binding |
missing-final-newline |
style | nursery | always | off | file does not end with a newline |
missing-printer |
pedantic | nursery | never | off | comparable abstract type whose interface exposes no printer |
needless-and-binding |
style | nursery | never | off | let rec binding riding an and-chain it does not need |
needless-append-empty |
style | stable | sometimes | off | append or concatenation with the neutral element |
needless-fun-match |
style | nursery | never | off | fun-then-match over an otherwise unused final parameter |
needless-list-length |
perf | stable | sometimes | on | List.length compared with 0 or 1 to test emptiness |
needless-list-map-before-concat |
perf | stable | never | on | List.map feeding concatenation builds an intermediate list |
needless-mutually-recursive-types |
style | stable | never | off | and-chained type that is not mutually recursive with its group |
open-of-ordinary-module |
restriction | nursery | never | off | an open of a module that is not made to be opened |
outdated-str-module |
style | stable | never | off | reference into the outdated Str module |
quadratic-list-append |
perf | stable | never | on | list append folded with the accumulator on the left |
quadratic-string-concat-chain |
pedantic | stable | never | off | a chain of three or more (^) segments |
quadratic-string-concat-fold |
perf | stable | never | on | string concatenation folded through (^) |
redundant-bind-return |
style | stable | never | off | bind into a bare return re-wraps the value unchanged |
redundant-boolean-comparison |
suspicious | stable | sometimes | on | comparison with a boolean constant |
redundant-boolean-operator |
style | stable | never | off | boolean operator with a constant operand |
redundant-conversion-roundtrip |
perf | stable | sometimes | on | conversion immediately undone by its inverse |
redundant-guard-true |
suspicious | stable | sometimes | on | when guard that is literally true or false |
redundant-if-bool |
style | stable | sometimes | off | if whose both branches are boolean literals restates the condition |
redundant-list-roundtrip |
perf | stable | never | on | list converted to a sequence and immediately back |
redundant-match-bool |
style | stable | sometimes | off | boolean match interrupting an if/else chain |
redundant-nested-if |
style | stable | sometimes | off | else-less if directly nested in an else-less if |
redundant-not-not |
style | stable | sometimes | off | double boolean negation |
redundant-option-comparison |
pedantic | stable | sometimes | off | comparison with None spells an Option predicate |
redundant-option-roundtrip |
perf | stable | never | on | option converted to a list only to take its head back |
redundant-return-bind |
style | stable | never | off | bind of a fresh return wraps a value only to unwrap it |
restricted-dependency |
restriction | stable | never | off | reference to a dependency forbidden by workspace policy |
restricted-export-name |
restriction | stable | never | off | exported name breaking the configured naming policy |
restricted-global-mutable-state |
restriction | stable | never | off | toplevel mutable state in library code |
restricted-public-exception |
restriction | stable | never | off | exception declared in a public library interface |
suspicious-ambiguous-constructors |
suspicious | nursery | never | off | constructor that shadows a standard constructor |
suspicious-catch-all-handler |
suspicious | stable | never | on | wildcard exception handler swallows every exception |
suspicious-duplicate-condition |
suspicious | stable | never | on | else-if condition that duplicates the previous arm’s |
suspicious-exit-in-library |
suspicious | stable | never | on | exit referenced in library code |
suspicious-failwith-in-library |
restriction | stable | never | off | failwith referenced in library code |
suspicious-file-exists-race |
restriction | stable | never | off | exists check guarding a filesystem operation on the same path |
suspicious-general-float-equality |
pedantic | stable | never | off | bit-exact equality on floats |
suspicious-if-same-branches |
suspicious | stable | never | on | if whose two branches are written identically |
suspicious-ignored-partial-application |
suspicious | stable | never | on | ignore of a value that is still a function |
suspicious-literal-condition |
suspicious | stable | never | on | if over a literal true or false condition |
suspicious-lost-backtrace |
suspicious | stable | never | on | work between catching and re-raising can overwrite the backtrace |
suspicious-physical-equality |
suspicious | stable | never | on | physical comparison with a non-immediate operand |
suspicious-polymorphic-compare-on-opaque |
suspicious | stable | never | on | polymorphic comparison of a Set, Map, or Hashtbl value |
suspicious-print-debugging |
restriction | stable | never | off | console printing entrypoint referenced in library code |
suspicious-rec-without-recursion |
suspicious | stable | sometimes | on | let rec group that never recurses |
suspicious-sequence-ignored-value |
suspicious | stable | never | on | pure projection discarded where the compiler cannot warn |
suspicious-str-formatter |
suspicious | stable | never | on | reference to the process-global Format.str_formatter |
suspicious-swallowed-cancellation |
suspicious | stable | sometimes | on | total handler around eio code converts cancellation into a value |
suspicious-transposable-arguments |
pedantic | stable | never | off | three adjacent same-typed unlabeled parameters |
suspicious-unused-module-binding |
suspicious | stable | never | on | module binding the unit never uses and never exports |
suspicious-variant-arity-tuple |
suspicious | stable | never | on | constructor whose one argument is a parenthesized tuple |
suspicious-wall-clock-elapsed |
suspicious | stable | never | on | duration computed from wall-clock reads |
trailing-whitespace |
style | stable | always | off | trailing spaces or tabs at end of line |
unsafe-obj-magic |
restriction | stable | never | off | use of Obj.magic |
untyped-ignore |
restriction | nursery | never | off | ignore discards a value without naming its type |
untyped-wildcard-binding |
restriction | nursery | never | off | let _ discards a value without naming its type |
wildcard-over-owned-variant |
restriction | nursery | never | off | a wildcard arm in a match over a variant the code owns |
unsafe-partial-stdlib |
restriction | stable | never | off | reference to a partial stdlib eliminator |
unused-export |
suspicious | nursery | never | off | exported value never used by another unit |
used-underscore-binding |
suspicious | nursery | never | off | underscore-prefixed binding is used |

