Fork me on GitHub
#clj-kondo
<
2020-08-10
>
plins19:08:16

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 😕

dominicm19:08:55

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

borkdude19:08:18

@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?+)

borkdude19:08:59

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

borkdude19:08:21

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

plins19:08:41

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

borkdude19:08:15

maybe even better:

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

borkdude19:08:48

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

plins19:08:27

am I missing something?

borkdude19:08:04

can you show the ns form of your test file?

plins19:08:40

(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]))

borkdude19:08:49

and your usage of the symbol?

plins19:08:20

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

Derek19:08:05

thrown+? vs thrown?+

Derek19:08:23

+? and ?+

plins19:08:54

oh sorry for that >.<

plins19:08:27

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)