keep-starknet-strange / cairo-lint

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

Add `bool_assert_comparison` #82

Open 0xLucqs opened 1 week ago

0xLucqs commented 1 week ago

What it does

This lint warns about boolean comparisons in assert-like macros.

Why is this bad?

It is shorter to use the equivalent.

Example

assert_eq!("a".is_empty(), false);
assert_ne!("a".is_empty(), true);

Use instead:

assert!(!"a".is_empty());
Josue19-08 commented 1 week ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello @0xLucqs, I would like to participate in this issue. I am part of Dojo Coding and have been working with this language. I would be happy to contribute to this project. I am familiar with languages such as Java, C#, .NET, C++, JS, and TS.

How I plan on tackling this issue

I would replace the boolean comparisons in assert! macros with direct assertions, simplifying the code and making it more readable. Then, I would test the changes to ensure everything works as intended.

MariangelaNM commented 1 week ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hi, I'm Mariángela, a software developer with a passion for innovative solutions. I'm excited about the opportunity to contribute to this project and collaborate with the team.

How I plan on tackling this issue

Replace assert_eq! and assert_ne! with assert! and its negated form as appropriate and review codebase to ensure that assertions are written in a more concise and idiomatic manner.

0xLucqs commented 1 week ago

@Josue19-08 the floor is yours. Don’t hesitate to ping me if you need any help

Josue19-08 commented 1 week ago

Thanks @0xLucqs, excited to get started

Manush-2005 commented 1 week ago

Hey @0xLucqs, I would like to take this issue up and contribute to cario lint from onlydust

0xLucqs commented 1 week ago

@Manush-2005 it's already assigned i'll try to find something else for you but i'm afraid you didn't really understand the goal of this project

Manush-2005 commented 1 week ago

Hey @0xLucqs , sorry for raising an PR without understanding the core problem. I am closing the PR I rasied and finding another issue and will solve it using your help. Thanks for the reply