crystal-lang / shards

Dependency manager for the Crystal language
Other
758 stars 99 forks source link

Refactor resolver code #574

Open straight-shoota opened 1 year ago

straight-shoota commented 1 year ago

The three resolvers git, hg and fossil share a lot of very similar code. The latter ones are both based on the git implementation. Just copying the code was nice for getting started. But that much duplication carries a technical debt. It's hard to keep track of things, especially when there are slight differences between the implementations, some of them seemingly arbitrary. The code should be consolidated, and similar pieces merged together.

Two recently fixed bugs #569 and #573 only existed in the git resolver. The other two used basically the same code, but with the bugs already fixed. The fixes were never brought back to the git resolver, though.

I think quite a bit of shared functionality can be abstracted and put in a general utility module. A major common aspect is the CLI, running processes with error handling etc.