Fork me on GitHub
#clj-kondo
<
2022-02-19
>
jaide14:02:05

Drafting p/try and p/catch for promesa.I've configured :lint-as so that kitchen-async.promise/try and catch match the clojure core counterparts but it seems like kondo is checking for catch and not (p/catch) which is resulting in that lint error. Is that fixable somewhere along the way or perhaps is this a non-starter?

jaide15:02:25

@U04V15CAJ Thoughts on this ^ Want to know if it's worth solving or if it's a can of worms for tools like kondo

borkdude15:02:29

@U8WFYMFRU p/catch already exists in promesa. how would you re-use it for this macro?

jaide15:02:53

In kitchen-async they introduce a separate name (which was going to be my strategy too) . The way they set it up was that there was p/catch for p/try and p/catch* for promise.catch. Was thinking on reversing that so promesa.catch* would be the counterpart to promesa.try. But it seems like getting p/try working and using lint-as might create more problems given that kondo is throwing an error that there is no catch statement in there

jaide15:02:40

So if it's not too much trouble in kondo (willing to help with the PR) then I'll continue with the promesa PR, but if it just creates more problems then it may not be worth implementing

borkdude15:02:26

there's always a way to support this in clj-kondo via hooks

borkdude15:02:47

it even has support for better-cond via custom hooks which is quite complicated

borkdude15:02:58

so there's no reason to restrain yourself here

jaide15:02:58

I see so I can start out with using hooks in my userland config, then can include it in the promesa config when I'm ready for that upstream PR?

jaide16:02:27

That works, thanks once again for your insight!

👍 1
lread16:02:35

I started https://github.com/clj-kondo/clj-kondo/discussions/1593. All with an interest and/or opinions are most welcome.