Closed plexus closed 5 years ago
Funny how running this today on an old repo I didn't run into one but two separate bugs :)
Upstream issue https://github.com/xsc/rewrite-clj/issues/70
This is excellent, thank you for providing the fixes and adding some tests, that'll come in handy to build upon in the future I'm sure. Shame about the uneval nodes but nice that there's a way around it. Hopefully the upstream issue will get fixed at some point so it doesn't catch other people out too. As you mentioned though, it might be entirely intentional for some reason.
Released in v1.5.1
.
Addresses two bugs in the --update code:
The presence of "uneval" (#_foo) nodes in a dependency map would cause an exception. While rewrite-clj.zip/right skips over whitespace and comments, it does not skip over uneval nodes, breaking our assumption that a map always has an even amount of children.
An empty dependency map (e.g.
:deps {}
or:extra-deps {}
) would cause the code to "fall off" the zipper by trying to descend into an empty map. This results isnil
, which in turn caused deps.edn to be overwritten by an empty file.I figured better late than never time to add some tests, so I added test cases for the affected functions. I also took the liberty to add Kaocha to the project, I hope that's ok.