quantifyearth / shark

3 stars 1 forks source link

Tidy and refactor md.ml #56

Closed mdales closed 4 months ago

mdales commented 4 months ago

I needed to both debug and then update md.ml, but process_run_block was too big for me to follow properly. This is a start of trying to split it out into code that has smaller units of work, and has unit tests where possible. It also makes explicit the idea that we have some execution state that is being updated after every command, rather than being in a tuple that sort of implied that.

The aim here isn't to be perfect, just nudge things to a state where I find it easier to follow the logic of execution. The API I've added isn't very neat, which is related to the fact that the code is somewhat interesting in many things, but I hope that by defining explicit APIs I can clean up some of the mess I've been making as I've expanded shark with wildcards, environment variable subs, etc.

patricoferris commented 4 months ago

Thanks @mdales -- merging now to get this in as it might cause some conflicts