Closed jeparlefrancais closed 9 months ago
Coverage after merging remove-assert-call-rule into main will be
87.02% |
---|
If removing the assert() results in an empty block, will that block be removed? If there's a simple boolean expression gating the block, will that also be removed?
If removing the assert() results in an empty block, will that block be removed? If there's a simple boolean expression gating the block, will that also be removed?
Hey Matt 👋 The idea is that the empty do block is being removed by the remove_empty_do
rule after in the process sequence. And by a boolean gating the block, do you mean something like this:
if someCondition() then
assert(...) -- that would get converted to a `do end`
end
That would still leave an empty if statement right now. That gives me an idea for a rule I could make that could restructure empty control flow statements though. Something that takes empty ifs and loops and flattens them into do block that preserves potential side effects. I need to think about this 🤔
Closes #2
Add a new rule
remove_assertions
that remove calls to theassert
global functions