I’m creating an elixir CLI to automate some release management tasks commonly performed internally in our engineering teams.
In addition to passing this CLI around, I’d also like some things to be configurable different from engineer to engineer, such as location of the directory where all repos should be cloned to or found (this CLI does things like clone all our microservices and apps, process commands across all of them - local environment maintenance and release preparation type activities).
I started by going down the road of saying that every engineer will have a yaml file in his home directory such as “.whateverrc”, and I read and parse all engineer-specific config values from there.
Is there a better practice in the elixir or erlang world?
As much as I despise YAML, that’s a reasonable solution if the engineers aren’t Elixir savy. If they are it’s pretty simple to copy the iex model and have a .iex.exs file of Elixir code that you import at runtime.
In general, the practice with Elixir CLI tools like iex and mix is that the configuration files are Elixir code with the .exsextension to differentiate runtime code vs compiled code. Only you can know if that’s a bridge too far for your users.