Fork me on GitHub
#clj-kondo
<
2021-02-23
>
jumar10:02:03

What's the best way to teach clj-kondo about slingshot's special "features"? E.g. I have this catch clause inside try+ and the linter reports "unresolved symbol" for both status, body, and &throw-context.

borkdude10:02:18

@jumar We have a hook for this in clj-kondo/config: https://github.com/clj-kondo/config

jumar10:02:05

Thanks, I'll have to figure out how to include it in my setup 🙂.

borkdude10:02:21

This is explained in its README

metame14:02:11

For the new unresolved-var linter is there a way to exclude namespaces using a wildcard? Whttp://e.ge have yesql bringing in our sql functions using defqueries that are all in namespaces like .queries.yesql.account and I don’t want warnings for any unresolved vars coming from .queries.yesql.* namespaces.

metame14:02:11

Essentially, this is what we’re doing now: https://github.com/clj-kondo/config/tree/master/hugsql but that no longer works

borkdude14:02:37

@U774Z4VJA This should still work if you haven't defined any other vars in those namespaces

borkdude14:02:51

If the namespace is empty (as far as clj-kondo is concerned), then it will be ignored with respect to the unresolved-var linter

metame14:02:52

Ok, I will play around with it and see. Right now it seems the same as the hugsql example I posted, but will verify.

borkdude14:02:43

There should be no file associated with that namespace in the .clj-kondo .cache in this case

metame14:02:12

ya still erring. My yesql ns is like:

(ns com.core.db.query.yesql.webhook
  (:require [yesql.core :as yesql]))

(yesql/defqueries "sql/core/webhook.sql")

metame14:02:34

And still getting warning: Unresolved var: yesql.webhook/find-webhook-by-id

borkdude14:02:18

At the moment there is no wildcard, but you can turn the unresolved-var linter off for now and post an issue

metame14:02:50

Ok thanks, will try to get a min case and post an issue later today or tomorrow. Many thanks @U04V15CAJ

borkdude14:02:29

Btw, you might be able to disable linting for these namespace completely using the :output config

borkdude14:02:39

this is based on filename where you can use regex

metame15:02:25

Ok cool will look into that as a workaround