Fork me on GitHub
#clj-kondo
<
2022-11-01
>
steveb8n22:11:58

Q: I just started using clj-kondo. it’s warning me about adding docstrings in deftest forms. Cursive interprets these as docstrings so I’m trying to figure out my path forward. Do I block clj-kondo from checking this or figure out a more idiomatic way to add docstrings to tests. what is the idiom?

steveb8n22:11:45

not really a kondo question but arises thanks to it’s effectiveness

borkdude22:11:27

> it’s warning me about adding docstrings in deftest forms I've never seen this...

borkdude22:11:26

Do you have a better repro than this one?

borkdude22:11:35

Or do you mean: how do I add docstrings to tests? I think like this:

(t/deftest ^{:doc "Hello"} foo
  1)

borkdude22:11:56

E.g. this:

(t/deftest foo
  "Foo"
  1)
Doesn't add a docstring to #'foo - you can see that when writing (meta #'foo)

steveb8n22:11:52

great. I was hoping it would be something like that. I’ll try and report back

steveb8n23:11:32

great. the inline meta you show above works for Kondo and Cursive. Thanks!

steveb8n23:11:36

sleep well!

borkdude09:11:46

And maybe more importantly: it works for Clojure itself :)

steveb8n09:11:50

Oh yeah, that too 😂