This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-01-25
Channels
- # aleph (1)
- # announcements (6)
- # babashka (13)
- # beginners (21)
- # clj-http (25)
- # clj-kondo (23)
- # clojure (17)
- # clojure-europe (49)
- # clojure-nl (1)
- # clojure-norway (8)
- # clojure-uk (4)
- # clojuredesign-podcast (15)
- # clojurescript (6)
- # cursive (18)
- # datomic (22)
- # emacs (29)
- # hyperfiddle (55)
- # introduce-yourself (4)
- # polylith (34)
- # portal (10)
- # releases (1)
- # shadow-cljs (16)
- # spacemacs (2)
I've been wrestling with getting Java analysis in clj-kondo's cache to warn about 1.12 errors about Java static field calls First succesfull version locally now!
hmm, I saved built-in analysis for a lot of Java classes (
etc but this increases the binary size of clj-kondo from 40 to 75 mb, I wonder if there's a better way to do it...
is it computationally expensive to generate the analysis on the fly?
well, it requires downloading OpenJDK's source code and takes about 30 seconds. This is essentially what clojure-lsp is doing (cc @UKFSJSM38)
ah, i thought you were analyzing the jars directly. that makes sense
Oh! there's always more to learn...
I could also just include the most popular top 200 classes or so instead of a couple of thousands of them
@U04V15CAJ did you try UPX on clj-kondo binary? I'm using for clojure-lsp for linux and mac, it increases slightly the startup time but it's way faster than JVM one (if using native-image)
for lsp it doesn't matter much but clj-kondo can be invoked quite a few times (e.g. with xargs
) so I don't want to make it slower
guess what, the resource increase didn't come from those transit files at all, it already happened on master. some bisecting to do
I get exactly the same size (71mb) with the previous release tag, but on CI the binary is around 40mb, I'm still using 22.3.0 Java 11 on CI though... so maybe that's it
Am I correct that https://github.com/clj-kondo/clj-kondo/blob/8cbc5d90db8ae3a25b95322015023077e672109a/src/clj_kondo/impl/analyzer.clj#L2470 lists all acceptable values for :lint-as
target and it includes much more than just clojure.
. For example, I see datahike.api/q
, compojure.core/GET
, re-frame.core/reg-event-db
and many more.
Would it be easy to change the code here to flag if lint-as
is given for something clj-kondo doesn’t understand? It looks like it could be done if we replaced the ;; catch-all
line with more specific [nil nil]
maybe? And then the catch-all
were flagging anything else?
I’m trying to prevent situations when people add lint-as
to something unsupported and it silently makes no difference without clj-kondo flagging that.
I'm not sure if :lint-as can be exclusively used for that list, I think lint-as can also be used for hooks but I'm not 100% sure