This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-25
Channels
- # announcements (5)
- # babashka (23)
- # beginners (70)
- # cider (24)
- # clj-kondo (14)
- # cljsrn (2)
- # clojars (6)
- # clojure (195)
- # clojure-australia (1)
- # clojure-dev (2)
- # clojure-europe (27)
- # clojure-france (1)
- # clojure-nl (4)
- # clojure-norway (2)
- # clojure-spec (2)
- # clojure-uk (12)
- # clojurescript (3)
- # clojurewerkz (1)
- # core-async (21)
- # cursive (9)
- # datomic (37)
- # duct (3)
- # emacs (16)
- # events (4)
- # fulcro (34)
- # graalvm (12)
- # javascript (3)
- # jobs (4)
- # malli (1)
- # meander (3)
- # nrepl (1)
- # off-topic (27)
- # pathom (16)
- # re-frame (17)
- # reagent (19)
- # rewrite-clj (18)
- # sci (47)
- # shadow-cljs (179)
- # spacemacs (18)
- # sql (52)
- # tools-deps (80)
- # vim (27)
- # vrac (1)
- # xtdb (9)
hello everyone, I am trying to lint a defrecord but it seems like I am not getting unresolved vars reported, I am trying this snippet in the lint playground:
(+ a b)
(defrecord wow [a b]
(some [_]
(+ a b whatisthis)))
I can get a
and b
to report correctly in my first statement, but whatisthis
is not being reported as unrecognized/unresolved
I think there is some syntax problem, I cannot declare that function some
without an interface/symbol of somekind
Trying with this now:
(+ a b)
(defprotocol IAbc
(doit [_]))
(defrecord abc [a b]
IAbc
(doit [_]
(+ a b whatisthis)))
@verma clj-kondo might not have good analysis yet for the protocols part of defrecord, I’ll take a look when I’m at a keyboard
I am trying to write an analyzer for defcomponentk
from https://github.com/plumatic/om-tools/blob/master/src/om_tools/core.cljc#L257 using the new :hooks stuff in clj-kondo
@verma awesome! I checked and clj-kondo has pretty crude analyzing for defrecord's protocol parts at the moment. it basically lints it, with some things turned off. https://github.com/borkdude/clj-kondo/blob/466930149b0c8c3b50fab0df5c6d2fb482a03cb8/src/clj_kondo/impl/analyzer.clj#L926 There is room for improvement there, but now you know why it is like it is.
There is an old issue for it: https://github.com/borkdude/clj-kondo/issues/140 But I never got to it yet.
Meanwhile I did implement protocols in babashka/sci, so at least I have more understanding of it now 😉
Bumped it a little bit in the "medium priority" column: https://github.com/borkdude/clj-kondo/projects/1