I have an interesting one. I'm working on a project that has something like this (sql/defsql "filetoload.sql" :as q)
the sql/defsql
is a defmacro
that uses hugsql. I've read the helpful tips about hugsql on the wiki, but in this case it doesn't apply, since...
the macro does this (in its internals) (alias '~alias query-namespace#)
where the alias
is the q
above.
so, in the namespace, I get this:
(a moment, just editing file)
So, the q
is defined in the namespace as an alias
. It is then used in that namespace as q/some-hugsql-thingie
, but clj-kondo doesn't know anything about it.
I've put up an example here <https://github.com/dharrigan/clj-kondo-unresolved-namespace>
@dharrigan oh man :)
I didn't even know hugsql could do this
I think it's more the project I'm working on, and the way they've done it, rather than hugsql 🙂
but yeah....I hear you
but I think you could write a hook for this, shouldn't be too hard
and if you figure the hook out, you could contribute it to: https://github.com/clj-kondo/config/tree/master/resources/clj-kondo.exports/clj-kondo
I'll see if I can get some time to think about how to do it
or perhaps you could put (comment (alias 'q ...))
in there, so clj-kondo thinks there is an alias q
, but this would be a workaround