clj-kondo

https://github.com/clj-kondo/clj-kondo
jumar 2021-02-23T10:20:03.011900Z

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.

borkdude 2021-02-23T10:21:18.012500Z

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

jumar 2021-02-23T10:23:05.012800Z

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

borkdude 2021-02-23T10:24:21.013Z

This is explained in its README

metame 2021-02-23T14:48:11.015400Z

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 <http://com.us|com.us>.queries.yesql.account and I don’t want warnings for any unresolved vars coming from <http://com.us|com.us>.queries.yesql.* namespaces.

metame 2021-02-23T14:50:11.015600Z

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

metame 2021-02-23T14:50:16.015900Z

afaict

borkdude 2021-02-23T14:50:37.016100Z

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

borkdude 2021-02-23T14:50:51.016300Z

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

metame 2021-02-23T14:51:52.016600Z

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

borkdude 2021-02-23T14:52:43.016900Z

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

metame 2021-02-23T14:54:12.017100Z

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")

metame 2021-02-23T14:54:34.017300Z

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

borkdude 2021-02-23T14:55:18.017500Z

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

metame 2021-02-23T14:55:50.017700Z

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

borkdude 2021-02-23T14:56:01.017900Z

:thumbsup:

borkdude 2021-02-23T14:59:29.018100Z

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

borkdude 2021-02-23T14:59:39.018300Z

this is based on filename where you can use regex

metame 2021-02-23T15:00:25.018500Z

Ok cool will look into that as a workaround