-
Notifications
You must be signed in to change notification settings - Fork 15
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: vm.skip(true) #63
feat: vm.skip(true) #63
Conversation
@alexfertel I'm opening this so you can take a quick look (I changed a bit the idea/added an optional toml for this kind of optional setup). Let me know what you think and I'll add docs/natspecs afterward, in the meantime, I'll replace the StringLiteral by the correct solang expression in the sol translator |
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.
Looking very good!
I see some changes, for which I'm pushing back a bit. But otherwise this is super close and I think could be merged.
Do you mind adding an integration test for this as well?
Yo! If you need any help or anything at all lmk, quite excited about this getting merged! |
hmm, one small extra thingy to add: we now need forge-std as an import (but I guess it's not too opiniated to add it when a cheatcode is being inlined too, right @alexfertel ?) |
Yup, it's fine to do so since we are tied to foundry anyway for now. It should be well-documented both in doc comments and the README. |
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.
Yo! This is looking great! 🚀
I left a few small comments and tweaks that should be quick to resolve. Lmk if you have any thoughts or questions!
- bool not ref - typos/naming Co-authored-by: Alexander González <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
|
@@ -236,6 +238,23 @@ impl<'s> Visitor for EmitterI<'s> { | |||
|
|||
Ok(emitted) | |||
} | |||
|
|||
fn visit_statement( |
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.
good bot. This visitor is actually never reached (tried adding a test here, it's only the fmt which is emitting the statements, which kinda look weird actually, or I misunderstood how the emitter/formatter are working together)
It's the last pending thing iic, rest has been fixed
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.
Note that emitter
is used by bulloak scaffold
and the formatter is used by bulloak check
. Though I'm not sure which formatter you are referring to.
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.
Yeah, wasn't super clear, my bad.
Latest commit fixed what I meant (the emitter wasn't emitting the function call)
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.
Awesome! Thanks for this wonderful contribution! 🚀
I'll run a few sanity checks locally and make a couple of small adjustments before merging and then cut a release that includes this hopefully tomorrow!
Add a vm.skip(true); at the beginning of each function (closes #57)
Without this forge cheatcode, tests are being run and show as "Pass", even when empty (false positive). With this cheatcode, they would show as "Skipped"
Implementation
A new node is added in the hir tree itself, after reading an optional bulloak.toml (which should contain a
no_skip
bool, set to true if this cheatcode should not be included in the final test)