clj-kondo

https://github.com/clj-kondo/clj-kondo
plins 2020-08-10T19:09:16.319700Z

how can I exclude the symbol thrown+? from being linted globally? its added by slingshot as an extension of a multimethod, so there is no namespace attached to it :unresolved-symbol {:exclude [(thrown?+)]} is not working 😕

dominicm 2020-08-10T19:10:55.320600Z

That's only within clojure.test, it's not global

borkdude 2020-08-10T19:12:18.321700Z

@plins The way you're using that config is that it will ignore unresolved symbols inside calls to thrown?+. If you want to ignore the unresolved symbol itself you simply write thrown?+ instead of (thrown?+)

borkdude 2020-08-10T19:12:59.322100Z

Full config: {:linters {:unresolved-symbol {:exclude [thrown?+]}}}

borkdude 2020-08-10T19:13:21.322500Z

You can also attach this on the test namespace's metadata so it will only exclude it there

plins 2020-08-10T19:13:41.322900Z

it was supposed to be nested inside linters, thank you very much 😄

borkdude 2020-08-10T19:14:15.323300Z

maybe even better:

{:linters {:unresolved-symbol {:exclude [(clojure.test/is [thrown?+])]}}}

borkdude 2020-08-10T19:14:48.323700Z

so then it will only ignore it within clojure.test/is

borkdude 2020-08-10T19:15:54.323900Z

^ @plins

plins 2020-08-10T19:16:23.324Z

plins 2020-08-10T19:16:27.324400Z

am I missing something?

borkdude 2020-08-10T19:18:04.324600Z

can you show the ns form of your test file?

plins 2020-08-10T19:19:40.324900Z

(ns zendesk-app.unit.domain.user-test
  (:require [clojure.test :as t]
            [integrant.core :as ig]
            slingshot.test
            [zendesk-app.boundaries.frontend.protocol :as fe]
            [zendesk-app.boundaries.oauth.protocol :as oauth]
            zendesk-app.domain.user.impl
            [zendesk-app.domain.user.protocol :as sut]
            [zendesk-app.helper :as h]))

borkdude 2020-08-10T19:20:49.325100Z

and your usage of the symbol?

plins 2020-08-10T19:21:20.325400Z

(t/is (thrown+? #(= % expected-err)
                      (sut/fetch user-service
                                 (:customer-id expected-user)
                                 (:user-id expected-user)
                                 (:zd-token expected-user))))

Derek Passen 2020-08-10T19:23:05.325600Z

thrown+? vs thrown?+

Derek Passen 2020-08-10T19:23:23.325900Z

+? and ?+

borkdude 2020-08-10T19:23:28.326100Z

right

plins 2020-08-10T19:23:54.326300Z

oh sorry for that >.<

plins 2020-08-10T19:29:27.327300Z

I know hooks are the way, but Im wondering if there is already some example somewhere on to configure slingshot macros (`try+` and its special catch)

borkdude 2020-08-10T19:31:55.327500Z

As a matter of fact, there is: https://github.com/borkdude/clj-kondo/tree/master/examples/slingshot

❤️ 2