What are my eyes seeing [1] ! Obviously, it worths trying, we have to
get rid of all that zombies that makes the code too difficult. But
first, I would try to add unit tests for each file we want to fix. We
should be ensure that we are only killing zombies and not simply ugly
people :)
[1]
https://github.com/yast/yast-installation/pull/761/files#diff-d71ded583f464fd64dec8c6c3fcbd16eL95
On 11/8/18 4:18 PM, Martin Vidner wrote:
Hi,
it was Halloween last week so my mind turned to zombies, in
particular those beginning with Yast::Builtins and Yast::Ops.
As you may remember, we have a zombie killer:
https://rubygems.org/gems/zombie-killer
https://github.com/yast/zombie-killer
Originally I set a too ambitious goal: automatically removing
zombies if I can automatically prove that it is safe, mostly by
ensuring that their arguments are not nil. That did not work out.
But we can still have something useful if we concede that the
resulting code will have to be tested anyway.
So `zk -e` is an "eager mode" of the zombie killer which does not
care about the arguments possibly being nil, and simply replaces
`Ops.add(a, b)` by `a + b` and so on.
Here's an example of it in action:
https://github.com/yast/yast-installation/pull/761/files
Let me know if it helps you (or not).
--
To unsubscribe, e-mail: [email protected]
To contact the owner, e-mail: [email protected]