clj-kondo

https://github.com/clj-kondo/clj-kondo
2020-04-28T11:40:48.030300Z

Hello, how can I search a function signature that resembles my macro signature?

2020-04-28T11:41:55.031300Z

I've tried to lint a macro like clojure.core/def and I got warning: inline def

borkdude 2020-04-28T11:51:22.031600Z

@d.ian.b What does your macro look like when called?

2020-04-28T11:51:46.031900Z

aw, changed to var and looks cool

2020-04-28T11:52:02.032300Z

another one that I can't find resemblance is

2020-04-28T11:52:23.032700Z

(defmacro spy-on [fun-monitor-pair & body] ,,,,

2020-04-28T11:53:18.033500Z

(helpers/spy-on [fn1 fn1-mon fn2 fn2-mon] (body) )

borkdude 2020-04-28T11:53:34.034Z

looks like clojure.core/let to me

2020-04-28T11:53:41.034200Z

tried

2020-04-28T11:54:04.034600Z

: error: unsupported binding form a-namespace/fn1

borkdude 2020-04-28T11:54:24.035Z

it seems you have not given me the example like you are calling it

2020-04-28T11:54:39.035400Z

for (helpers/spy-on [a-namespace/fn1 fn1-mon] (body) )

2020-04-28T11:54:43.035600Z

sorry ^^'

borkdude 2020-04-28T11:55:54.035900Z

can you try clojure.core/binding?

2020-04-28T11:56:35.036100Z

error: unresolved symbol fn1-mon

borkdude 2020-04-28T11:57:03.036400Z

so where is fn1-mon coming from?

2020-04-28T11:57:20.036900Z

is a name that i'm giving

borkdude 2020-04-28T11:57:53.037700Z

so you have the name on the right instead of most macros which have the name on the right. that makes it incompatible

2020-04-28T11:57:56.037800Z

it's like inside a macro, i'm creating an atom named of this

2020-04-28T11:58:02.038Z

yeah

borkdude 2020-04-28T11:58:43.038800Z

maybe you could try changing your macro. and else: {:linters {:unresolved-symbol {:exclude [(foo.helpers/spy-on)]}}}

borkdude 2020-04-28T11:59:04.039200Z

I think in your code binding should work, if you reverse names to the left

2020-04-28T11:59:25.039600Z

Yeah, I will try this 😃

2020-04-28T12:04:15.040300Z

fixed the order of macro call, clojure.core/let did the job

2020-04-28T12:04:16.040600Z

😃

2020-04-28T12:04:23.040900Z

thanks @borkdude

2020-04-28T12:04:59.041300Z

It wasn't me that made the macro =(

borkdude 2020-04-28T12:08:29.041600Z

cool 🙂 preventing the Lisp curse with clj-kondo