Fork me on GitHub
#clj-kondo
<
2020-01-08
>
dharrigan09:01:36

There's quite a common macro called when-let*, as described here:

dharrigan09:01:53

Presently, I get an error from clj-kondo on linting

dharrigan10:01:05

So I'm trying to get clj-kondo to do the right thing

dharrigan10:01:26

i.e., {:lint-as {foo.bar/when-let* clojure.core/let}}

dharrigan10:01:52

that doesn't seem to work (still reports an error that the symbol cannot be resolved)

dharrigan10:01:23

if I change it to clojure.core/when-let then it complains thus error: when-let binding vector requires exactly 2 forms

dharrigan10:01:39

Any suggestions on how to get clj-kondo to do the right thing?

yuhan10:01:33

@dharrigan I have the same macro in my util ns and it's linted as clojure.core/let with no issues

yuhan10:01:53

maybe check for typos?

dharrigan10:01:06

thanks - will check

dharrigan10:01:05

Ah - yes, I forgot - I had joker as well

dharrigan10:01:31

i.e., let g:ale_linters = {'clojure': ['clj-kondo', 'joker']}

dharrigan10:01:41

removing joker worked

🤡 4
practicalli-johnny22:01:31

I removed joker last year. It's a much better experience with just clj-kondo

dharrigan10:01:59

confirmation that it worked for you, made me look elsewhere 🙂

yuhan10:01:48

I'm pretty sure clj-kondo's features are a superset of joker's by now, there's little reason to have both

dharrigan10:01:23

Yeah, I've removed it 🙂

borkdude16:01:12

I think you can use {:clj-kondo/config {:linters ...}} as namespace metadata. Doesn't work for all linters, but I believe it works for :unresolved-symbol

borkdude16:01:38

oh I responded while not having read your code... sorry 🙂 I see you're already doing that

borkdude16:01:18

you need to quote the metadata value: so '{:linters ...}

deleted16:01:34

it worked!

👍 4
borkdude16:01:40

Btw, I haven't got testing yet in spartan.test, but that would be nice. Lint-as should also work here: {:lint-as {spartan.test/deftest clojure.test/deftest}}

borkdude16:01:23

I'm going to add testing right away.

borkdude17:01:20

I'll add thrown? and thrown-with-msg? later today