Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add impossible_comparisons #76

Open
0xLucqs opened this issue Sep 18, 2024 · 4 comments
Open

Add impossible_comparisons #76

0xLucqs opened this issue Sep 18, 2024 · 4 comments
Labels
good first issue Good for newcomers lint

Comments

@0xLucqs
Copy link
Contributor

0xLucqs commented Sep 18, 2024

What it does

Checks for double comparisons that can never succeed

Why is this bad?

The whole expression can be replaced by false, which is probably not the programmer’s intention

Example

if status_code <= 400 && status_code > 500 {}

EDIT: Partially implemented

@0xLucqs 0xLucqs added good first issue Good for newcomers lint labels Sep 18, 2024
@MariangelaNM
Copy link
Contributor

MariangelaNM commented Sep 18, 2024

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hi @0xLucqs can I work on this?

Copy link

onlydustapp bot commented Sep 18, 2024

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

@0xLucqs
Copy link
Contributor Author

0xLucqs commented Sep 18, 2024

Yes ! Do you have any idea on how to do it ?

@MariangelaNM MariangelaNM removed their assignment Sep 18, 2024
@MariangelaNM
Copy link
Contributor

MariangelaNM commented Sep 18, 2024

I'm going to start the issue, I can reassign it again.

0xLucqs pushed a commit that referenced this issue Oct 4, 2024
* Implement is_impossible_double_comparison

* New test to validate the Impossible comparison

* Update is_contradictory_double_comparison

* Update

* Add the cases

* clean code

* Change the validations to is_redundant_double_comparison
@0xLucqs 0xLucqs closed this as completed Oct 9, 2024
@0xLucqs 0xLucqs reopened this Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers lint
Projects
None yet
Development

No branches or pull requests

2 participants