Fork me on GitHub
#clj-kondo
<
2024-03-26
>
bzmariano20:03:04

Hello, does anyone know where should I put the "{:clj-kondo/config {:ignore [:unresolved-symbol]}}" when I define a new macro, so that the linter doesn't paint the whole buffer in red wherever I use this macro 😅

hiredman20:03:13

You cannot put it in the macro definition, kondo is a static analyzer, it doesn't expand macros

dpsutton21:03:16

you can include it as metadata on the macro

dpsutton21:03:17

(defmacro foo
  {:clj-kondo/ignore [:unresolved-symbol]}
  [& body]
  )

bzmariano21:03:52

maybe you can guess from where I got this code ...

dpsutton21:03:39

that doesn’t know that defspel creates a symbol walk that you can use

bzmariano21:03:42

my question is if it is possible to ignore the linting when I use the second macro (defspel)

dpsutton21:03:53

clj-kondo doesn’t even know that that’s a macro

dpsutton21:03:00

the trick i showed only works one level

dpsutton21:03:20

you’ll need to do more to teach clj-kondo

dpsutton21:03:43

should be easy to mark defspel as similar to a def. But I don’t know how you could do it inline

bzmariano21:03:38

I've never needed to manually configure clj-kondo so I don't know if this is even possible. I could not solve this reading through the docs (which are great btw)

borkdude21:03:23

@U05H80AEKMM do you mean, you don't know where to put the config? (re: the original message) this is in .clj-kondo/config.edn

bzmariano23:03:41

HI, (sorry for the @ mention) I was trying to see if there was a way to add this config 'inline' for defspel.

borkdude07:03:22

ah yes, what @U11BV7MTK said then