Proposal to move project configuration under specific keys


Code like this one

      # Hex
      description: "A toolkit for data mapping and language integrated query for Elixir",
      package: package(),

      # Docs
      name: "Ecto",
      docs: docs()

Whereas you can see some folks labeled some keys under some comment for an obvious reason; since those keys are actually correlated to each other and actually belongs to specific tools that use them.

I also suffer from these organization on my projects which I copy-paste the structure of the project config pretty much.

I would propose to actually enforce (not sure how or if this is a right move) or at least be disciplined when it comes to adding keys under project config. Since avoiding conflicts or adding complexity when it comes to understanding all these keys.

Situations like this one, I would prefer to move description inside package key and name inside docs.

Maybe synchronize with the authors of those packages and deprecate the global keys since both of them belongs to Elixir Core and Hex Core, should be easy to synchronize with them.


Yes, this is not a bid deal and it works today, but I would prefer to change it today when the community is not that big to be resilient about changes.

Better to do what is right (which I could be wrong in thinking that this is the right thing to do) than pay off the cost later on because minors things like this didn’t matter but too many minor things became a big thing.

What is your opinion about it?


Things in the root are used by mix and elixir. It allows introspection of applications at runtime. Things under the package and docs keys are used specifically by hex and exdoc respectively. It is a convenience that hex and exdoc don’t make you repeat the same keys that elixir requires in their own sections. It doesn’t make sense to require those keys under the hex and exdoc sections, because those are tools you may not be using. Also, it would be building into mix knowledge of tools outside the elixir-lang repo. If you still really want to put that information under package and docs, I’m 90% sure you can override them in the nested maps.


Ahhh so description is shared, fair enough that one could stay as it is.

I am guessing that name is related to ex_doc and it could be moved into docs. Is that correct?

This is why I would like to have some standardization on what people are doing around package config since I have no way to know who injected the config there (per key) without knowing the entire ecosystem and what my packages are doing at any given point of time.

Maybe it is not an issue today, and it is just a matter of documentation :man_shrugging:


hex and ex_doc use name


Right, but why both of them spec a key under project instead of docs or package?

Either ex_doc came out with the required key and then Hex decided to use, or another way around.

But the issue is that both of them wants shared config and they don’t want to rely on some struct under specific key.

Just replicate the key in both configs (docs, package) and simple use module attribute or simple variable names for share the config.

Or read from the other configuration.

Also, notice that even Ecto folks put labels for Hex and Docs and they decided that name is actually for Docs when this is not quite true from what you are saying.

This is why I said that maybe is an issue of discipline, but this is a little confusing and unmanageable to know without knowing so much about the ecosystem.