This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-05
Channels
- # announcements (23)
- # babashka (23)
- # beginners (48)
- # calva (41)
- # clj-kondo (41)
- # cljs-dev (75)
- # cljsrn (5)
- # clojure (85)
- # clojure-europe (46)
- # clojure-nl (2)
- # clojure-spec (70)
- # clojure-uk (4)
- # clojurescript (52)
- # core-async (2)
- # cursive (16)
- # datahike (2)
- # datomic (4)
- # emacs (15)
- # figwheel-main (2)
- # fulcro (5)
- # gratitude (5)
- # helix (14)
- # introduce-yourself (2)
- # jackdaw (13)
- # keyboards (2)
- # lsp (8)
- # luminus (5)
- # malli (3)
- # meander (12)
- # nextjournal (52)
- # off-topic (19)
- # other-languages (1)
- # overtone (3)
- # pathom (4)
- # podcasts-discuss (1)
- # re-frame (6)
- # reitit (1)
- # releases (2)
- # ring (3)
- # sci (22)
- # shadow-cljs (3)
- # specter (1)
- # testing (3)
- # tools-deps (100)
- # uncomplicate (2)
Not exactly babashka question. I think this channel needs to be renamed to "borkdude helpline" or something 🙂 I need to write a custom kondo hook/analyze-call for compojure.api.core macros. Has anyone done anything similar?
I can't say I've done it, but in case it helps, there's an example in the docs at <https://github.com/clj-kondo/clj-kondo/blob/master/doc/hooks.md#analyze-call>
@U0G75ARHC Let's take this to #clj-kondo which seems more appropriate for this question
@U0G75ARHC You can use :analyze-call
or :macroexpand
: the latter one is a bit easier than the first one but you'll get less precise warnings location-wise.
> Let's take this to #clj-kondo Ooops. I got confused when searching; Slack has not suggested me the channel while I was typing. Emacs completion frameworks have spoiled me. Joining the channel posthaste.
kondo's source has implementation for compojure, but a) it's not the same as compojure.api b) there's a lot going on there in clj-kondo.impl.analyzer
I don't know if can find all pieces there I need to build that hook
Good morning! We are automating a lot of infra stuff with bb, and I got tired of writing the same boilerplate code for HTTP clients over and over again…
Still trying to find an elegant way for path params (and probably a more elegant way to dynamically create the client functions)
@U04V15CAJ as far as I see, babashka.curl has no concept of path parameters, right?
Thought cljs-ajax had them, but I was wrong. The concept is more often used to describe the API in the server, I guess, clients can build their URLs quite easy after all
and it's a bit overkill for just putting together a string with some slashes perhaps?
Love reitit, but agree that it might be too much. Will strengthen my regex chops for this one :)
@U0N9SJHCH There is this ruuter
library which is compatible with bb.
https://github.com/askonomm/ruuter
Perhaps there are some parts that you can lift out for your purposes.
@U0N9SJHCH i use a fn like this: https://github.com/lispyclouds/contajners/blob/main/src/contajners/impl.cljc#L56-L71 for using path params supplied as a map in a url picked up from a swagger yaml. quite simple but good enough for my usecase 😄 maybe its of your interest?
And i too use it in conjuction with bb curl 🙂
@U7ERLH6JX Similar to what I tried, but nicer. Going to steal it (with attribution and according to license 🙂 ) Thanks!
🙏:skin-tone-3:🙏:skin-tone-3: