Fork me on GitHub

yeah this is the kind of thing where the whole plugin architecture hits its own limits. The config hook runs after plugins are loaded, because plugins are needed to run the hook. There is actually a mechanism for this, a plugin is really just an implementation of a plugin/-register multimethod, which is passed the current plugin chain, and returns an updated plugin chain. Typically it just adds itself, but you can add as many plugins as you want there.


Or call the -register method of other plugins


(defmethod plugin/-register ::my-plugin [_ plugins]
  (->> plugins
       (plugins/-register :kaocha.plugins/notifier)
       (plugins/-register :kaocha.plugins/version-filter)))


This seems to work, with one difference: I ended up having to call plugins/register without the hyphen so namespaces get loaded etc


makes sense


defplugin is really just syntactic sugar, in the end a plugin is just a map with an id and hook functions, which gets added to this list of plugins, which is then bound to plugin/*current-chain*


this will even let you remove or reorder plugins if you so please


Thank you both! I think the register thing is going to be the solution in my case. I had been thinking about sharing a base config file but since they need to be included by path, that's a bit tricky using git deps (which is how my lib is distributed). The reader literal approach looks very neat and I might come back to it if the register one doesn't work out.