Fork me on GitHub
#clj-kondo
<
2022-09-02
>
Cora (she/her)17:09:41

how would you get clj-kondo to lint a new assertion (is (not-thrown?...) with the same linter for (is (thrown?...)

Cora (she/her)17:09:40

within the context of clojure.test, I mean

borkdude17:09:49

this is currently not configurable. you could just suppress this symbol with :unresolved-symbol :exclude

Cora (she/her)17:09:04

alright, thank you!

Noah Bogart18:09:38

The way I do this (also seen in https://github.com/clojure-expectations/clojure-test/blob/031f55fe494d3cbf1e77039a41b2b2a60048a11a/src/expectations/clojure/test.cljc#L46) is to write a macro that throws for each new assertion and then refer them. Then, the assert-expr method will expand before the referred var can expand

Noah Bogart18:09:12

This lets you put doc strings on the vars too, which is nice

Cora (she/her)18:09:44

ahhhh that's tricky but workable. I think I'll just suppress the symbol for this tiny usage, though. thanks, Noah!

👍 1