-
-
Notifications
You must be signed in to change notification settings - Fork 830
Deprecate _ as x patterns #4683
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
base: main
Are you sure you want to change the base?
Conversation
Looks good so far Eugenio! Could you add some tests for both the formatting and the warning? You can have a look at the |
🌟 Added tests! 🌟 |
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.
Hello! Could you rebase on main please? There's some conflicts. Thank you
compiler-core/src/warning.rs
Outdated
|
||
type_::Warning::UnusedDiscardPattern { location, name } => Diagnostic { | ||
title: "Unused discard pattern".into(), | ||
text: format!("_ as {name} can be written more concisely as {name}"), |
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.
text: format!("_ as {name} can be written more concisely as {name}"), | |
text: format!("_ as {name} can be written more concisely as {name}"), |
text: format!("_ as {name} can be written more concisely as {name}"), | |
text: format!("`_ as {name}` can be written more concisely as `{name}`"), |
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.
Done!
Thanks @giacomocavalieri and @lpil for your support! |
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.
Thank you!!
Oops, tests are failing. Could you rebase to remove the merge commits also please 🙏 |
Hello Eugenio, is this ready for review? Remember to un-draft it when it is! |
Hi @giacomocavalieri, no, it’s not. It's still failing the tests. |
We're failing |
@lpil I could try And here are the changes:
|
The latest commit on main should have fixed the clippy lints, unless you introduced more in this PR. If you rebase on main now, they should all pass |
@GearsDatapacks @lpil rebased |
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.
Thank you!! Few tiny notes
┌─ /src/warning/wrn.gleam:4:10 | ||
│ | ||
4 │ _ as b -> b | ||
│ ^ |
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.
│ ^ | |
│ ^^^^^^ |
Can we make the arrow point to the whole thing that would be replaced please 🙏
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.
This hasn't been done yet 🙏
compiler-core/src/warning.rs
Outdated
}, | ||
extra_labels: vec![], | ||
}), | ||
hint: Some(format!("Replace with {name}")), |
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.
Let's drop the hint as the text covers it pretty much
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.
This hasn't been done yet!
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.
I know, sorry... I just had a lot of things to do. Will fix this evening
This aims to fix #4664.
I'm new here, so I hope to have done everything right.