kaocha

plexus 2021-09-21T07:03:55.056500Z

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.

plexus 2021-09-21T07:04:24.056800Z

Or call the -register method of other plugins

plexus 2021-09-21T07:05:43.057Z

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

imre 2021-09-21T12:46:56.061900Z

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

👍🏻 1
plexus 2021-09-22T05:33:36.062200Z

makes sense

plexus 2021-09-21T07:06:48.058100Z

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*

plexus 2021-09-21T07:07:28.058400Z

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

imre 2021-09-21T10:01:48.061800Z

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.