Hello!
I have this (maybe weird) use case: I am designing a lib having the following fns as of now:
• client: taking in a single param opt map {:url "
• invoke: taking in 2 params: the above client and an opt map: {:op :SomeOperation :options {:foo 42 :bar 77} ...}
this lib has access to specs based on the version and the operation name :SomeOperation in this case which it can use to validate the opts map.
What I would like to do is to be able to lint the (invoke client opts) call, specially the values in optsstatically. Are hooks the right thing for it?
The way i understand is that I should be shipping a custom analyze-call hook for invoke where in i do that check and emit messages?
yes
good to know that its a direct answer (and that i understand the hooks doc). one more thing, i am trying to keep the lib bb compatible too and thinking of using malli to check the opts map. it should be okay for SCI to run my hook right? given malli is on the classpath?
no :) macroexpand hooks do not load any dependencies. you can only use the clj-kondo hooks API. You can of course define helpers functions, even in other files, but nothing from the classpath is loaded. clj-kondo has its own idea of a classpath for hooks
also it's not the same as bb. It is SCI, but not with the same classes, etc as bb.
right had a feeling it might be like that. lemme see if i can do a manual spec verification with plain clojure, im not expecting the data to be too fancy.
thanks, back to the hammock