This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-04
Channels
- # announcements (9)
- # bangalore-clj (1)
- # beginners (164)
- # calva (7)
- # clj-kondo (12)
- # cljs-dev (5)
- # cljsrn (7)
- # clojure (100)
- # clojure-spec (5)
- # clojure-sweden (2)
- # clojure-uk (4)
- # clojurescript (9)
- # conjure (22)
- # datomic (53)
- # fulcro (62)
- # graalvm (27)
- # helix (10)
- # joker (6)
- # malli (1)
- # mount (4)
- # nrepl (3)
- # off-topic (8)
- # quil (1)
- # releases (1)
- # sci (42)
- # shadow-cljs (1)
- # testing (7)
- # tools-deps (26)
- # vim (24)
I'm trying to use clj-kondo with the docker file. I can't seem to get it to use the cache directory. I'm running this command:
sudo docker run -v $PWD/src:/src -v $HOME/.m2:$HOME/.m2 -v $HOME/.clj-kondo:$PWD/.clj-kondo borkdude/clj-kondo clj-kondo --cache-dir=$HOME/.clj-kondo --lint "$(lein classpath)"
The way I'm reading the project setup section, I'm expecting to see it generate files in the project's .clj-kondo directory but it's not creating anything in there. Am I running the command incorrectly or have I misunderstood?Note that $HOME
gets expanded in your shell before it goes into docker, at least I think so
I would think something like
docker run -v $HOME:$HOME borkdude/clj-kondo clj-kondo --cache-dir=$PWD/.clj-kondo --lint "$(lein classpath)"
should work as long as PWD is somewhere in HOME. Since lein classpath
evaluates outside of docker, that classpath string has to end up making sense to clj-kondo running inside docker. I think you might be able to add -w $PWD
to set the working dir, and then not have to set --cache-dir
since .clj-kondo is the default. So
docker run -v $HOME:$HOME -w $PWD borkdude/clj-kondo clj-kondo --lint "$(lein classpath)"
When I ran this on my project, I found that it gave me the same results as if I ran without docker (including running the hooks in my local .clj-kondo)@U0143KP47M4 thank-you! that worked, wrote to my cache dir. It makes sense, I've got it checking my source properly now I believe.
👍 3