-
Notifications
You must be signed in to change notification settings - Fork 34
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
Feat: Add manual assert #101
Feat: Add manual assert #101
Conversation
crates/cairo-lint-core/src/fix.rs
Outdated
if let Expr::InlineMacro(inline_macro) = &statement_expr.expr(db) { | ||
let panic_message = inline_macro.arguments(db).as_syntax_node().get_text_without_trivia(db); | ||
let condition_text = condition.as_syntax_node().get_text_without_trivia(db); | ||
let assert_condition = condition_text.trim_start_matches('!'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't do that, take the if condition from the Expr::If
crates/cairo-lint-core/src/fix.rs
Outdated
panic_message.trim_matches(&['(', ')'][..]).replace("\"", "").trim(), | ||
condition_text.split('.').next().unwrap_or(&condition_text), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is that ?
@@ -0,0 +1,79 @@ | |||
//! > check-if-then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add more tests for example one with if else
don't only check the happy path you need to think of edge cases
Hey i'll close this, as there's still plenty of work to do and we won't have time to do it by the end of the week. I'll still pay you though |
manual_assert
#62