Fork me on GitHub
#clj-kondo
<
2024-03-15
>
Joshua Suskalo19:03:18

Hey, how hard would it be to get the misplaced-docstring lint to also detect when the pre/post map is before the string? I found an example in a production codebase today that looked like

(defn foo [args]
  {:pre [(some expression)]}
  "this is the docstring, it's badly placed lol"
  (stuff))

👍 1
borkdude20:03:16

Doesn’t this already give you an unused value warning?

Joshua Suskalo20:03:14

Actually it didn't, but I hadn't stopped to think about why.

borkdude21:03:24

I’ll take a look later, afk now

borkdude21:03:50

alright, yeah, I think it should either report a misplaced docstring, or an unused value, can you post an issue?

Joshua Suskalo21:03:34

Yeah, can-do. I'll make sure this is reproducible in a file with fewer errors and that kondo isn't just giving up, and file an issue.

🙏 1