Skip to content

CV13 — IN with a single value is just =

Group: Convention · Auto-fixable: yes

x IN (v) tests one value, so x = v (or x <> v for NOT IN) is clearer and lets the planner use an index. Lists and subqueries are left alone. The fix swaps the operator and drops the parentheses.

bad: WHERE status IN ('active')
good: WHERE status = 'active'

Disable this rule in banshee.toml:

[lint]
exclude = ["CV13"]

Or silence one line with -- noqa: CV13. See Linting.