keep-starknet-strange / cairo-lint

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

feat: add ifs_same_cond #114

Closed Gianfranco99 closed 2 weeks ago

Gianfranco99 commented 1 month ago

Summary 📌 This PR Resolves: https://github.com/keep-starknet-strange/cairo-lint/issues/87

What it does: This PR introduces a new lint that detects consecutive if statements with the same condition. When two if or else if blocks check the same condition, this could be an indication of a copy & paste error, and this lint helps prevent such mistakes. All tests pass image

0xLucqs commented 3 weeks ago

any news ?

Gianfranco99 commented 3 weeks ago

any news ?

Done, I'm going to do a push now. @0xLucqs

Gianfranco99 commented 3 weeks ago

still need the 1==1 test

I had added that test but I deleted it since there was a conflict with a new test that validates the same condition and it generated conflicts in the file showing another error message, but if you want we can see how we solve this and also add that test @0xLucqs

0xLucqs commented 2 weeks ago

@all-contributors please add @Gianfranco99 for code and tests

allcontributors[bot] commented 2 weeks ago

@0xLucqs

I've put up a pull request to add @Gianfranco99! :tada: