boolean-symbol
What it does
Section titled “What it does”Reports the symbol :true or :false.
Why it matters
Section titled “Why it matters”:true is a symbol, and in a condition it is truthy like any other symbol, including :false. It is almost always a boolean meant to be true or false.
To fix, write true or false.
Example
Section titled “Example”x = :truey = :ok...end...h = { true: 1 }Configuration
Section titled “Configuration”ruby: lint: rules: boolean-symbol: warn # off, warn (default), errorEnabled by the presets: ruby/rubocop.
Suppress one line with sudsy-disable-next-line boolean-symbol in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools. full: Sudsy reports what the upstream rule reports; partial: only part of it, as the last column says.
| Tool | Rule | Match | What differs |
|---|---|---|---|
| rubocop | Lint/BooleanSymbol |
partial | # rubocop:disable comments are not read |