This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-10-14
Channels
- # announcements (1)
- # asami (3)
- # aws (1)
- # babashka (22)
- # beginners (39)
- # calva (21)
- # clj-kondo (10)
- # cljdoc (22)
- # cljs-dev (17)
- # clojure (93)
- # clojure-australia (3)
- # clojure-europe (39)
- # clojure-italy (3)
- # clojure-losangeles (17)
- # clojure-nl (14)
- # clojure-russia (2)
- # clojure-uk (5)
- # clojurescript (35)
- # community-development (7)
- # conjure (2)
- # cursive (13)
- # data-science (1)
- # datomic (25)
- # emacs (5)
- # events (4)
- # figwheel-main (2)
- # fulcro (12)
- # graphql (7)
- # gratitude (2)
- # inf-clojure (6)
- # leiningen (6)
- # lsp (49)
- # malli (13)
- # membrane (30)
- # minecraft (1)
- # pathom (3)
- # pedestal (26)
- # polylith (13)
- # portal (2)
- # quil (3)
- # random (1)
- # re-frame (13)
- # reagent (43)
- # reitit (6)
- # releases (1)
- # reveal (2)
- # ring (3)
- # shadow-cljs (30)
- # specter (5)
- # sql (8)
- # tools-build (1)
- # tools-deps (13)
- # videos (1)
I'm trying the instrument example from the documentation, while I get the report in the REPL, kondo isn't emitting the lint warnings for it. Am I missing anything?
@ben.sless Have you added the emitted config to your clj-kondo config?
Looks like I am missing something. The emitted config is written by malli by default to .clj-kondo/configs/malli/config.edn
, do I need to include it somehow?
yeah, in .clj-kondo/config.edn
you need to write {:config-paths ["configs/malli"]}
Thanks, this solved it for me as well π A question on clj-kondo/malli integration: when a function takes a map as parameter, clj-kondo is highlighting if the passed parameter is not a map, but it does not highlight if the value under a certain key is not correct type. Is this expected, and a hard limitation of clj-kondo/malli, or something that just has not been done (because it will require a lot of work, etc.). I just want to know where to set my expection. π
Hey, I ran into the following when converting a schema to PlantUML.
(def value
[:and
{:description "Non negative numeric value."
:json-schema/example 780.56}
number?
[:>= 0]])
(def simple-registry
(merge
(m/default-schemas)
(mu/schemas)
{:value value}))
(def schema-merged
(mu/closed-schema
(m/schema
[:merge
[:map
[:name string?]
[:age value]]
[:map
[:address string?]]]
{:registry simple-registry})))
(comment
(plantuml/transform schema-merged))
Now, trying to render PlantUML results in :malli.core/invalid-schema {:schema :merge}
.
Does plantuml/transform
support stuff outside malli.core
?
The schema-merged
above expands into following schema:
[:merge [:map {:closed true} [:name string?] [:age [:and {:description "Non negative numeric value.", :json-schema/example 780.56} number? [:>= 0]]]] [:map {:closed true} [:address string?]]]
Not sure why the plantuml transform doesn't do this but if you deref the schema, it works:
(plantuml/transform (m/deref schema-merged))
Whatβs the replacement for a set as a predicate in malli?
Analogue of (s/def :spec1 #{:a :b})
Is it
[:or [:= :a] [:= :b]]
?
right! danks @U3L6TFEJF