Fork me on GitHub
#leiningen
<
2021-10-14
>
Shayden Martin23:10:43

Can someone help me understand the reason behind the recommendation https://github.com/technomancy/leiningen/blob/master/doc/PROFILES.md#composite-profiles not to mix keywords and maps in a single composite profile?

Shayden Martin23:10:47

In particular, I want to make a small addition to an existing profile where in I add a single entry to :source-paths. In my scenario, this seems preferable:

{:profile-1 { ... }
 :profile-2 [:profile-1
             {:source-paths ["extra/path"]}]}
over this:
{:profile-1 { ... }
 :profile-3 {:source-paths ["extra/path"]}
 :profile-2 [:profile-1 :profile-3]}

eskos15:10:03

Might be they don't merge properly/behave as you'd expect. Not sure though. Also, recommendation isn't a hard no 🙂 It's more like "you have been warned"

Shayden Martin22:10:23

Thanks for the response. My fear is that they won’t merge properly. Without understanding the rationale behind the recommendation, it may as well be a hard no unfortunately because I don’t know what risks I’m assuming by ignoring it.

noisesmith23:10:10

you can use the lein-pprint plugin to see the effective merged config for a given profile https://github.com/technomancy/leiningen/tree/stable/lein-pprint

noisesmith23:10:02

my suspicion is that it doesn't deep merge the profiles, and just overwrites the top level keys if provided