keep-starknet-strange / cairo-lint

A collection of lints to catch common mistakes and improve your Cairo code.
21 stars 35 forks source link

Add `bool_comparison` #36

Closed 0xLucqs closed 2 months ago

0xLucqs commented 3 months ago

What it does

Checks for expressions of the form x == true, x != true and order comparisons such as x < true (or vice versa) and suggest using the variable directly.

Why is this bad?

Unnecessary code.

Example

if x == true {}
if y == false {}

use x directly:

if x {}
if !y {}

https://rust-lang.github.io/rust-clippy/master/index.html#/bool_comparison

lauchaves commented 3 months ago

Hey @0xLucqs, may I give this one a try ? 🚀

onlydustapp[bot] commented 3 months ago

Hey @lauchaves! Thanks for showing interest. We've created an application for you to contribute to Cairo lint. Go check it out on OnlyDust!