This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-23
Channels
- # announcements (10)
- # babashka (7)
- # beginners (31)
- # boot (4)
- # calva (8)
- # chlorine-clover (19)
- # cider (12)
- # clj-kondo (27)
- # cljsrn (7)
- # clojure (68)
- # clojure-colombia (2)
- # clojure-europe (47)
- # clojure-italy (16)
- # clojure-nl (4)
- # clojure-spec (13)
- # clojure-uk (39)
- # clojurescript (103)
- # code-reviews (8)
- # community-development (2)
- # conjure (38)
- # core-async (37)
- # cursive (2)
- # datascript (1)
- # datomic (31)
- # figwheel-main (22)
- # fulcro (18)
- # jobs (2)
- # jobs-discuss (6)
- # juxt (3)
- # keechma (1)
- # lambdaisland (6)
- # malli (30)
- # meander (20)
- # off-topic (29)
- # reagent (1)
- # reitit (16)
- # shadow-cljs (4)
- # tools-deps (70)
- # xtdb (19)
@borkdude finally got around to set up the Rum hook but there’s something to still figure out, with defcs
and defcc
there’s an implicit first argument. Since that is not passed at callsites, clj-kondo will say the function is called with the wrong arity. Would be happy to try to adapt the hook to support that. Do you think that’d require custom hooks or can it be made to work with the same lint-as
approach?
@martinklepsch If the arities are different, then the hooks probably need to be slightly different as well. I wasn't aware of that detail, sorry. I know @robert-stuttaford is also using the hook. Hasn't he ran into this yet? Maybe he doesn't use defcs
?
yes, we also have this, just haven't gotten round to doing the good opensource citizen thing and writing it up 😞
@borkdude I think I’m close. Ttrying to construct a modified argvec using this (api/vector-node (rest a))
but somehow not quite doing what I expect:
INPUT <vector: [state r]>
OUTPUT <vector: [[:format-string "[%s]"][:wrap-length 2][:seq-fn #object[clojure.core$vec 0x3ac6c820 "clojure.core$vec@104a1
ea78"]][:children (<token: state> <token: r>)]]>
WANTED <vector: [r]>
Also worth noting, printing the args vector node seems to omit spaces so the <vector: [state r]>
above is actually printed as <vector: [stater]>
@martinklepsch what is a?
<vector: [state r]>
I found out about vector-node
reading this but don’t know much about rewrite-clj so missed the :children
bit
anyways, this seems to work
now the issue however is that the first arg isn’t known inside the function
:thinking_face:
you can fix this by introducing an artificial let binding with that name, bound to e.g. nil
cool, will do!
@martinklepsch Any luck with that?
got sidetracked by some other stuff after realizing that it’s not just a static token but could also have different names or be a destructuring form