This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-05
Channels
- # announcements (3)
- # babashka (64)
- # bangalore-clj (1)
- # beginners (12)
- # calva (21)
- # cider (7)
- # clj-kondo (16)
- # cljdoc (1)
- # clojure (49)
- # clojure-dev (2)
- # clojure-europe (10)
- # clojure-germany (3)
- # clojure-italy (1)
- # clojure-uk (13)
- # clojuredesign-podcast (6)
- # clojurescript (2)
- # code-reviews (21)
- # data-science (2)
- # datomic (3)
- # emacs (20)
- # events (1)
- # fulcro (2)
- # graphql (4)
- # java (3)
- # malli (14)
- # off-topic (45)
- # re-frame (2)
- # shadow-cljs (7)
- # tools-deps (167)
- # vrac (14)
- # xtdb (4)
The demo on ClojureD was schematized malli fn's emitting clj-kondo type definitions. I'll make a real impl out of that now with the clj-together funding. Not the first thing, but will most likely need help with that @borkdude, will poke you when about to do that. The second thing, which would be a nice experiment is if malli itself could be used inside clj-kondo to validate both malli data and schemas, e.g.
(do-it {:Type "AWS::AppSync::ApiKey"
:Descriptionz "kikka"})
.. would emit clj-kondo errors:
{:ApiId ["missing required key"]
:Descriptionz ["should be spelled :Description"]}
autocomplete-stuff: I don't know how to do those, and most likely don't have to study that, but happy to help on Malli side if someone want's to try that out
with the :multi
dispatch key validation, it would yield:
(do-it {:Type "AWS::ApiGatway::UsagePlan"
:Description "kikka"
:UsagePlanName "kukka"}
.. would emit clj-kondo errors:
{:Type ["should be spelled \"AWS::ApiGateway::UsagePlan\""]}
@ikitommi I tried a similar thing using the type system in clj-kondo. It can be done, but it only works at places where literal maps are passed. So when you use assoc et al, it already breaks (although I think I have some logic which tries to account for that, it's been a while)
I recently listened to a podcast with Tony Kay. He is working on something similar called GuardRails Pro which will be closed source
@jeroenvandijk small changes:
• :dispatch
is mandatory in :multi
, e.g. can’t set via Schema creations opts => this makes it visible for error handling
• malli.error/with-spell-checking
now understands :multi
dispatch values if the :dispatch
value is a keyword
https://github.com/metosin/malli/pull/252/commits/fecd792d02e20a9a22730ea0163b661c539eaa79
(-> (m/explain
Schema
{:Type "AWS::AppSync::ApiKey"
:Descriptionz "kikka"})
(me/with-spell-checking)
(me/humanize))
; loaded "AWS::AppSync::ApiKey"
; => {:ApiId ["missing required key"]
; :Descriptionz ["should be spelled :Description"]}
(-> Schema
(m/explain
{:Type "AWS::ApiGatway::UsagePlan"
:Description "kikka"
:UsagePlanName "kukka"})
(me/with-spell-checking)
(me/humanize))
; => {:Type ["did you mean AWS::ApiGateway::UsagePlan"]}
Wow, super nice. Thanks!