This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-04-13
Channels
- # aleph (3)
- # announcements (2)
- # babashka (15)
- # beginners (84)
- # biff (28)
- # calva (2)
- # cherry (1)
- # clj-kondo (24)
- # clojure (69)
- # clojure-austin (35)
- # clojure-brasil (7)
- # clojure-conj (2)
- # clojure-europe (83)
- # clojure-losangeles (1)
- # clojure-nl (1)
- # clojure-norway (13)
- # clojure-portugal (5)
- # clojure-turkiye (2)
- # clojurescript (25)
- # css (4)
- # cursive (11)
- # data-science (26)
- # datahike (4)
- # datalevin (2)
- # emacs (19)
- # gratitude (1)
- # honeysql (1)
- # hyperfiddle (45)
- # introduce-yourself (5)
- # lsp (53)
- # malli (8)
- # mid-cities-meetup (1)
- # nrepl (19)
- # pathom (23)
- # practicalli (2)
- # proletarian (1)
- # rdf (2)
- # reagent (28)
- # releases (4)
- # shadow-cljs (11)
- # sql (13)
- # uncomplicate (6)
- # vim (7)
- # xtdb (3)
There is a kondo analysis missing issue that happens a lot in Nubank projects that if fixed would help a lot developing, especially completion lsp feature 🧵
After some debugging I found it's related with the usage of schema.core/defn
, when you have a map with odd pairs all analysis of that function are lost:
This works, returning all keywods, var-usages and other analysis as expected, even with invalid map (common when you are writing code and completing):
(defn foo []
(str {:a 1 :b}))
This doesn't return any analysis inside foo:
(schema.core/defn foo []
(str {:a 1 :b}))
Is quite easy to spot the issue in editor where lens, semantic tokens and other features are missing for s/defn:
I think this kondo only repro proves it:
clj -Sdeps '{:deps {clj-kondo {:mvn/version "2023.03.17"}}}' -m clj-kondo.main --config '{:config-paths ^:replace [] :output {:format :json :analysis {:keywords
true}}}' --lint - <<< '(ns foo (:require [schema.core :as s])) (s/defn foo [] (str {:a 1 :b}))' |jq .
Any chance that in the future clj-kondo could add static analysis support for the for-by
macro used in Electric Clojure?
• e/for-by
: a reactive map operator, stabilized to bind each child branch state (e.g. DOM element) to an entity in the collection by id (provided by userland fn - similar to React.js key).
See example
https://electric-examples-app.fly.dev/user.demo-system-properties!SystemProperties
@UA9399DFZ This is something that library authors or users can do themselves in the form of hooks
If you want I can guide you through that process. Then you can either contribute that back to the project or keep it as a separate dependency
Oh nice, I didn't know about hooks for extending clj-kondo. Thanks for the offer of guiding me through the process but I think I'm not the right person to take this on as don't really understand how electric works and I'm a noob at macros.
@U09K620SG is this possibly something the #C7Q9GSHFV team would consider for the future?
FYI @U09K620SG I'd be available in helping this
certainly we want to include this
hey y’all, I’m doing some local library development and I’m running into an issue where I’ll update a library to say, add a function, but clj-kondo isn’t recognizing that function in another project that uses the updated library. how do I resolve this?
@U0AQ1R7FG are you using clj-kondo directly in emacs or via clojure-lsp?
via clojure-lsp
oh great, thanks!
that did it. thank you!
Hi. Referring back to this older question: https://clojurians.slack.com/archives/CHY97NXE2/p1636046966102200 This answer was given: https://clojurians.slack.com/archives/CHY97NXE2/p1636047101103800 I tried it, but for me it does not work. I also assumed maybe there is a typo in the response and it should rather be:
{:lint-as
{monger.operators/$set clojure.core/def
monger.operators/$addToSet clojure.core/def}}
?
Still, it has no effect… Is it possible that clojure-lsp (with Neovim) does not respect a project-local .clj-kondo/config.edn?After deleting the cache directory it works now. Thank you so much @U04V15CAJ!