Small question. I put my changelog in the :cljdoc.doc/tree vector at the end, but on the website it's pushed to the top. is this a deliberate thing? https://cljdoc.org/d/io.github.noahtheduke/splint/1.4.0/doc/home
Ya, cljdoc always puts anything it recognizes as a readme and a changelog at the top.
Medium question: I'm using a file from resources in a top-level var: (def version (str/trim (slurp "./resources/SPLINT_VERSION"))) . analysis is failing because of that: https://app.circleci.com/pipelines/github/cljdoc/builder/42020/workflows/11166ef0-b519-46c0-9ed5-7ba82da2d85f/jobs/58395 how do I solve this?
Wrap it in a delay and deref it where you need it. Having side-effects in top-level defs is a bad idea.
oh that's interesting
If you have a def with side effects, it's going to run whenever that ns is loaded -- including during AOT compilation.
As to why cljdoc is failing on this... if fetch the splint jar from clojars:
wget
And then:
unzip -l splint-1.4.0.jar | grep SPLINT
I see:
6 2023-05-08 09:16 SPLINT_VERSION
Which means SPLINT_VERSION is not under the ./resources dir in the split jar, hence the file not found.You'll want to use (io/resource "SPLINT_VERSION") in a JAR BTW
Also... just happened to notice lotsa .class files in the splint jar.
If you want folks to use splint as a library this will give headaches. If it is just used as a tool... maybe ok.
You want to read it from the classpath -- and resources will be part of the classpath. resources/SPLINT_VERSION is relative to where you run the process on the filesystem (which won't be true in a JAR)
BTW, I'm very much looking forward to trying out splint, it is on my todo list!
Interesting note about the .class files. how do I avoid that?
Are you building a library or an application here?
Libraries should not have .class files from Clojure code (only from Java code). Applications typically don't get deployed to Clojars.
You probably should not be compiling files for the JAR: https://github.com/NoahTheDuke/splint/blob/main/build.clj#L32
You're building a standalone uber for local use? And the (thin) library jar for Clojars for folks to depend on?
Yes