This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-01
Channels
- # adventofcode (93)
- # announcements (44)
- # asami (23)
- # aws (1)
- # babashka (48)
- # beginners (112)
- # calva (26)
- # cider (57)
- # clj-kondo (17)
- # cljfx (5)
- # cljs-dev (21)
- # clojure (124)
- # clojure-europe (19)
- # clojure-hungary (40)
- # clojure-nl (3)
- # clojure-spec (7)
- # clojure-uk (3)
- # clojurescript (3)
- # cursive (81)
- # datalog (11)
- # events (21)
- # exercism (1)
- # fulcro (37)
- # graalvm (1)
- # introduce-yourself (8)
- # jobs (1)
- # lsp (1)
- # malli (5)
- # membrane-term (17)
- # minecraft (3)
- # nextjournal (5)
- # off-topic (14)
- # other-lisps (14)
- # polylith (58)
- # reagent (16)
- # reclojure (3)
- # reitit (6)
- # remote-jobs (1)
- # shadow-cljs (55)
- # spacemacs (15)
- # testing (2)
- # tools-build (7)
- # tools-deps (191)
I’m starting to work with #re-frame. The various event and subscription functions (`re-frame/reg-event-db`, etc) accept a function (usually an anonymous function) that take a regular set of inputs. Would it be possible to write a lint that requires certain function parameters to have specified names?
example from here: https://day8.github.io/re-frame/subscriptions/#reg-sub
(re-frame.core/reg-sub
:id
(fn [db query-v]
(:something db)))
in the simplest usage, re-frame.core/reg-sub
takes a keyword and a function (binding the function to the keyword in a hidden global state like s/def
). the function must accept a hashmap and a vector. I’d like to specify that the hashmap always be named db
.this will keep all of the reg-sub
calls consistent and make writing the handling functions more clear (instead of potentially having one be db
and another be app-db
and a third be m
)
@UEENNMX0T Yes, you can write a hook for this
Last issue I think - For the ffi system, I define the functions with datastructures and then use these to generate functions in the namespace:
https://github.com/cnuernber/dtype-next/blob/clj-kondo-builtin/src/tech/v3/datatype/ffi.clj#L811
I attempted a macro expansion of define-library-functions!
but this could not use the data in the symbol - I had to use (resolve sym-name) in the macro in order to do this in Clojure and when sci is running the macro I can't resolve that variable like that.
One solution would be to collapse that all into one macro instead of a few macros. Then I could pass in the datastructure to the macro itself.
clj-kondo 2021.12.01 ✨
• Improve linting in `extend-protocol`, `extend-type`, `reify`, `specify!` https://github.com/clj-kondo/clj-kondo/issues/1333, https://github.com/clj-kondo/clj-kondo/issues/1447
• Support `:context` in nodes in hooks for adding context to analysis https://github.com/clj-kondo/clj-kondo/issues/1211
• goog.object
, `goog.string` etc must be required before use in newer releases of CLJS https://github.com/clj-kondo/clj-kondo/issues/1422
• Resume linting after invalid keyword https://github.com/clj-kondo/clj-kondo/issues/1451
• Fix install script for relative dir opts https://github.com/clj-kondo/clj-kondo/issues/1444
• Fix type mismatch error with auto-qualified keyword https://github.com/clj-kondo/clj-kondo/issues/1467
• String type hint causes false error report https://github.com/clj-kondo/clj-kondo/issues/1455
• Fix false positive with cljs/specify! https://github.com/clj-kondo/clj-kondo/issues/1450
• Improve analysis for ns-modifying destructuring key https://github.com/clj-kondo/clj-kondo/issues/1441
• CLJS `(exists? foo.bar/az)` complains about require https://github.com/clj-kondo/clj-kondo/issues/1472