I am using the missionary library. What I would like to do is get a warning message if missionary.core/? is being used outside of missionary.core/ap OR missionary.core/sp. Is clj-kondo able to such a hierarchical rule? Thanks!
@hoertlehner yes, using a hook you can check the :callstack to see what called you before
Many thanks @borkdude And sorry for asking this question. When I today went through history of slack, I did find a similar question. So it was my fault for not having read better the history of the chat before asking.
no problem!
Does anyone happen to know how you get the name of a failing linter? clj-kondo is throwing up an error that I want to tell it to ignore, but I don't know which linter is causing the issue.
Thanks! I was expecting it to be a flag rather than a config option, so I was looking in the wrong place!
Incidentally, I have code like:
(extend-protocol StreamableResponseBody
(Class/forName "[B")
(write-body-to-stream [body _ ^OutputStream output-stream]
(.write output-stream ^bytes body)
(.close output-stream)))
clj-kondo throws an error, but I'm unsure there's any other way to extend protocols to primitive arrays, at least not until Clojure 1.12. Should this be an error, or should clj-kondo not throw an error in this case?this has come up before: officially extend-protocol doesn't support expressions, just class symbols using multiple Class/forName's will even fail: https://clojure.atlassian.net/browse/CLJ-1381
so it would be probably better to use extend and use the somewhat more elaborate syntax
Ah, thanks. I'll change it to use extend .
Can't wait before the whole world upgrades to 1.12 :)
I get this indenting in Calva. I'm assuming it's kondo that handles this, but not certain:
(def a
'(catch
w
x
y
z))Kondo doesn’t do anything with indentation
ok I'll ask in #calva